views:

492

answers:

2

You can easily use the PropertyChanges events to set the flag but how do you easily reset it after a save to the ObjectContext?

A: 

what about the ObjectContext.SavingChanges event? See also http://www.thedatafarm.com/blog/2008/07/13/OverridingObjectContextSaveChanges.aspx.

Mark Cidade
+1  A: 

The above method calls for using the SavingChanges event which is called before the changes are persisted. If there is an error during the save, you have already cleared your dirty flag. I would think there would be a SavedChanges event exposed as well.

AndyMan