Is there a good way to detect when the ObjectContext changes are actually committed?
SavingChanges occurs before going to the data store but I also need a way to know if those changes where actually committed.
Thanks in advance
John
Update:
What I have is a code first DbContext. This is fed into dynamic data which as I discovered uses the DbContext’s internal ObjectContext (to which I have access when casting to IObjectContextAdapter). The dbcontext’s SaveChanges is not called, the objectcontext’s SaveChanges is used instead. All I want to do is to be notified after the save is complete (i.e. event SavedChanges) so I can invalidate my cache.
There is no build-in event to handle this but you can override
SaveChangesmethod in your derived context and fire any custom event specific to your own context type after you callbase.SaveChanges.