I'm DbContext updating to Entity Framework 7, and I usually override SaveChanges inside DbContext to be able to get a list of all changed objects before changing it. Ultimately, I have a script that starts tracking the previous version in the database. In Entity Framework 6, I would get model changes as follows:
var oc = ((IObjectContextAdapter)this).ObjectContext; var modifiedItems = oc.ObjectStateManager.GetObjectStateEntries(EntityState.Modified | EntityState.Deleted); List<ObjectStateEntry> ModifiedObjlist = modifiedItems.ToList();
However, now that the ObjectContext is deleted in Entity Framework 7, I'm stuck, how would I get a list of changed objects inside Entity Framework 7?
kevin c
source share