|
When you use Entity Framework, you can perform Insert/Update/Delete operations on your entities, and you eventually call ObjectContext.SaveChanges() to actually make it all happen. The call to SaveChanges() is either explicit, or can happen implicitly when you use the EntityDataSource (e.g. within a Dynamic Data application). Before SaveChanges() actually performs the operations, it gives you a chance to look at the entities, letting you modify them, and possibly cancel certain operations. Unfortunately, doing this requires using some pretty ugly code, because the API is a little too low level. Instead of nicely handing you the changes one by one, it just gives you the raw change list and lets you deal with it. For instance...
|