Entity Framework Audit Discover who support this features
Introduction
The audit allows you to log changes from Entity Framework change tracker in a database or log file.
Why Audit?
Entity Framework saves entities in a database but doesn't let you easily track changes. To follow all the changes, you will need to use a third-party library.
Common scenario:
- To keep a history of changes in a database or a log file
- Track What/Who/When a modification occurs
- Show historical data changes in a grid
Google Related Questions
StackOverflow Related Questions
- EF6 Code First Audit Table Per Entity
- Entity Framework 6: audit/track changes
- How to create an audit trail with Entity Framework 5 and MVC 4
- Does EF 6 and higher offer better ways of auditing interactions with the data?
- EF Auditing Creations
- Audit Log to Maintain History Against Records using Repository Pattern.
// using Z.EntityFramework.Plus; // Don't forget to include this. // AutoSave audit in a database AuditManager.DefaultConfiguration.AutoSavePreAction = (context, audit) => (context as EntityContext).AuditEntries.AddRange(audit.Entries); var ctx = new EntityContext(); // ... ctx changes ... var audit = new Audit(); ctx.SaveChanges(audit); // Access to all auditing information var entries = audit.Entries; foreach(var entry in entries) { foreach(var property in entry.Properties) { } }
Supported Libraries
Library | Type | EF Version | Support | Doc | Features |
---|---|---|---|---|---|
Z.EntityFramework.Plus | FREE | EF5 EF6 EF Core |
< 1 Day | Yes | Audit Batch Delete Batch Update Cache Deferred Query Filter Future Include Filter Include Optimized |
Audit.NET | FREE | EF6 EF Core |
< 1 Day | Yes | Audit |
Microsoft.EntityFrameworkCore.AutoHistory | FREE | EF Core | < 1 Day | No | Audit |
Unsuported Libraries
Use these libraries at your risk!
Library | Type | EF Version | Support | Doc | Features |
---|---|---|---|---|---|
AuditDbContext | FREE | EF6 | No | Yes | Audit |
EFAuditing | FREE | EF Core | No | No | Audit |
EntityFramework.Extended | FREE | EF5 EF6 |
No | Yes | Audit Batch Delete Batch Update Cache Future |
TrackerEnabledDbContext | FREE | EF6 | No | Yes | Audit |
ZZZ Projects