Reputation: 6297
The requirement is to track all changes made to an entity, track it to know who did it, when he did, etc. For example, I have a Person entity, and a user has changed the name of the person; I'd like to keep that information somewhere.
What's the best approach for this? Or is there an existing framework to achieve this.
I know that SQL 2008 has support for tracking changes, but it's not an option for now, because a lot of our customers are already using SQL 2005.
Is the Logging Application Block of Enterprise Library a good candidate for this requirement? I've check it out a little bit but, I don't see how I can use it to track the who did it, what value has change, when he did it, etc.
We are using C# and .NET framework for our app.
Upvotes: 2
Views: 1469
Reputation: 2524
Standrad way is to use events from INotifyPropertyChanging and INotifyPropertyChanged interfaces. And for collections INotifyCollectionChanged. Once you subscribed to this events you can store information wherever you want.
If you using MSSQL you can try Query Notifications
Upvotes: 1
Reputation: 27323
Some sort of AOP solution (like the one in enterprise library) should provide you with enough possibilities to create such a solution.
You can subscribe to a property-invoke method and log the information.
Upvotes: 0