c# - INotifyPropertyChanged for EF CodeFirst Navigation Properties -
i having trouble inotifypropertychanged on navigation properties entity framework code first objects. understanding known problem: reported here.
i have seen workarounds tie associationchanged event ef generated objects (example here). since class doesn't implement ientitywithrelationships, trying add class doesn't work. (i did try adding interface virtual property, doesn't work because being accessed in base class provide notification.)
i have tried adding notification when navigation property foreign key changes, doesn't seem happen until savechanges() method called, later me.
is there code first workaround?
edit: require code in every question, here go:
public class subanalysis { public virtual analysis analysis { get; set; } // attempt add notification // not fire until late (at savechanges?) public guid analysisguid { { return this.analysisguid; } set { if (this.analysisguid != value) { this.analysisguid = value; this.onpropertychanged("analysisguid"); this.onpropertychanged("analysis"); } } } }
Comments
Post a Comment