concept persistence process in category .net

appears as: persistence process, persistence processes
Entity Framework 4 in Action

This is an excerpt from Manning's book Entity Framework 4 in Action.

Suppose you want to log each persistence operation triggered by your application. One way to do this might be to create an extension method that performs an attach, add, or delete and then adds an entry to the logging storage. This implementation is naive because you might need to halt the persistence process for some reason, and you’d end up logging operations that hadn’t happened. (Yes, you could roll back the logging, but that’s not the point here.)

Another approach might be subscribing to the SavingChanges event, which is triggered before the persistence process begins (SaveChanges), retrieving entities in the Added, Modified, and Deleted states, and writing entries in the log. This solution, shown in the next listing, better serves your needs; it doesn’t even require you to create and use extension methods.