NHibernate Envers does a good job of creating an Audit Log whenever an entity is Updated/Deleted. Basically it creates an Audit table for each auditable entity and write a snapshot of the data into the Audit table. For e.g. if Customer records are saved in CUSTOMER table then audit log for Customer records will be saved in CUSTOMER_AUD table.
In one of my projects we are using Entity Framework 6.1. I have searched and looked at various alternatives like AuditDBContext and EntityFramework Extensions but none of them provide an out of box solution similar to NHibernate Envers.
I think generating an Audit Log should be a pretty common requirement, so my question is, whether there is any out of box solution for EF 6+ that generates the Audit Log similar to NHibernate Envers?
I ended up implementing a custom solution using the AuditDBContext.
Basically, I use the AuditDBContext to keep track of what properties have changed and then used that to write information to Audit tables. The audit tables exactly mirror the main tables with two additional columns:
Also take a look at https://github.com/bilal-fazlani/tracker-enabled-dbcontext
Its a bit different, but worth taking a look at.