Code first migration EF Core #570
Replies: 2 comments
-
It's not like that. EventEntry is not intended to be used as an entity class in a DbSet. Neither the library will detect the name of your DbSet. You must configure the audit output (Data Provider). To configure the output of your audits, you can use any of the provided Data Providers, which in your case it seems that you will use the EntityFramework DataProvider to store the audit events in the same DbContext you're auditing. So you have to define the structure of the audit table(s) since the library will make no assumptions at all. You could want to store the entire event in a single JSON column, or maybe have one audit table for each audited entity, maybe you just want some of the properties of the audit event, etc... You can see examples for the different configurations here, |
Beta Was this translation helpful? Give feedback.
-
Hello everyone. I use the EF Core library and I need the audit some tables.
Correct me if I'm wrong:
In order for everything to work, I need to implement a DbSet with this entity(https://github.com/thepirat000/Audit.NET/blob/master/src/Audit.EntityFramework/EventEntry.cs) in my context and call it Audit?
Something like this?
Beta Was this translation helpful? Give feedback.
All reactions