Is it possible to add the "DeleteOnNull=true" on a custom class instead of modifying the DBML (generated) class directly?
For example, let's say this is a 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 the "DeleteOnNull=true" on a separate class? Is it is? How? I have tried the following without any luck:
[MetadataType(typeof(OrderDetailMetadata))]
public partial class OrderDetail {
internal sealed class OrderDetailMetadata
{
[Association(DeleteOnNull = true)]
public object Order;
}
}