When I use DataSet, there is possiblity to raise events on RowChanging, RowChanged, ColumnChanging, ColumnChanged, etc...
How to do the same with an entity from Entity Framework ?
Entities already implement the PropertyChanged event since they implement System.ComponentModel.INotifyPropertyChanged. If you want to catch changes to your entieis, you can just subscribe to that.
PropertyChanged
System.ComponentModel.INotifyPropertyChanged
Also note that entities support the following two partial methods—the second of which should give you the equivalent of "RowChanging"—that you can override if you'd like to respond to changes within your class:
protected override void OnPropertyChanged(string property) {} protected override void OnPropertyChanging(string property) {}
1.4m articles
1.4m replys
5 comments
57.0k users