3

I'm using a Database First codestrategy, and have POCOs and context generated by EF4.x DBContext Generator.

In short when I was using ObjectContext, for triggering a notification I was extending a entity like this:

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 an ChangeNotification when Customer.Address = new Address. By default scalar properties are raising ChangeNotifications but Navigation Properties are not.

Ion Ciobanu
  • 506
  • 4
  • 13
  • possible duplicate of [Do I need to implement INotifyPropertyChanged when using EF Code-First?](http://stackoverflow.com/questions/6991396/do-i-need-to-implement-inotifypropertychanged-when-using-ef-code-first) – Gert Arnold Apr 29 '12 at 21:33
  • Well, possible. But to be specific I'm full aware of the EF dynamic proxies that extend basic POCO's at runtime and implement INotifyPropertyChanged, and that [msdn bugreport](http://connect.microsoft.com/VisualStudio/feedback/details/532257/entity-framework-navigation-properties-don-t-raise-the-propertychanged-event) the proxies don't work very very well. So basically this is another question, but it`s kinda related just because I`m implementing this in an MVVM-WPF solution. – Ion Ciobanu Apr 29 '12 at 21:45

0 Answers0