Reputation: 1063
I am working in a project where veracity of the data in the database is a very important aspect. 10 tables in my database have to be constantly revised, row per row, to confirm the correctness of the data.
I decided to implement a log system, where 3 users have to confirm that the row is correct before it can be finally approved. The problem is that I don't want to alter every table of the database, so I decided I would like to implement a single "polymorphic" table that will keep the log of all confirmations of the users for all the tables.
But, I couldn't figure out how to do it in entity framework. Is there a way to implement a polymorphic table in EF?
Thanks in advance!
Upvotes: 1
Views: 329
Reputation: 11327
Disclaimer: I'm the owner of the project EF+ (EntityFramework Plus)
You can use EF+ Audit to easily log every user confirmation in the database and even row modification for these tables. The library have also an "AutoSave" feature which will make this feature very easy to implement in your application.
// Include only entities which require a confirmation "IConfirmation"
AuditManager.DefaultConfiguration.Exclude(x => true);
AuditManager.DefaultConfiguration.Include<IConfirmation>();
// ... See documentation to configure AutoSave
Project: http://entityframework-plus.net/
Documentation: Entity Framework Audit Trail Context and Track Change
Upvotes: 1
Reputation: 69
maybe you can use enterprise library 6.0 logging
https://channel9.msdn.com/posts/Introducing-Semantic-Logging https://channel9.msdn.com/Events/Build/2013/3-336
Upvotes: 1