Entity Change Tracking using DbContext in Entity Framework 6

We've been searching for a way to audit changes made to our database, and one method we found was doing so via Entity Framework change tracking. Here's how to do it, what's required to set it up, and some drawbacks of this method. Let's get started! Background Entity Framework tracks changes made to entities when those entities are loaded from the Context. So, if we load an entity and modify it, like so: var movie = context.Movies.Find(2); movie.... Read more >

Object Change Tracking via Reflection in .NET

We have this big project we're working on (which I have written about before) and one of the things we need to do on this project is automatic logging of changes made to model objects. I've worked out a way to do this generically, for any object, and I think others might find it just as useful as we have. Requirements We needed to be able to compare two objects of the same type, examine their properties, and log which... Read more >