Is it possible to add “DeleteOnNull = true” to the user class instead of directly modifying the DBML class (generated)?
For example, let's say this is part of my generated dbml class:
[Table(Name="OrderDetails")] public partial class OrderDetail : INotifyPropertyChanging, INotifyPropertyChanged { // deleted for brevity [Association(Name="Order_OrderDetail", Storage="_Order", ThisKey="OrderId", OtherKey="OrderId", IsForeignKey=true, DeleteOnNull=true)] public Order Order { get { /* deleted */ } set { /* deleted */ } } }
So, is it possible to put "DeleteOnNull = true" in a separate class? This is true? How? I tried the following with no luck:
[MetadataType(typeof(OrderDetailMetadata))] public partial class OrderDetail { internal sealed class OrderDetailMetadata { [Association(DeleteOnNull = true)] public object Order; } }
source share