I am using a basic database strategy and have POCOs and context generated with EF4.x DBContext Generator.
In short, when I used an ObjectContext to trigger a notification, I expanded the object as follows:
public partial class Customer
{
public Customer()
{
this.AddressReference.AssociationChanged += AddressReference_AssociationChanged;
}
private void AddressReference_AssociationChanged(object sender, CollectionChangeEventArgs e)
{
OnPropertyChanged("Address");
}
}
Is there something similar when working with DBContext and POCOs?
EDIT:
I need this for ChangeNotification when Customer.Address = new address. By default, scalar properties raise ChangeNotifications, but Navigation Properties are not.
source
share