protected override void Dispose(bool disposing) { foreach (var entry in this.ObjectStateManager.GetObjectStateEntries(EntityState.Added | EntityState.Deleted | EntityState.Modified | EntityState.Unchanged)) { if (entry.Entity != null) { // Set the change tracker to null IEntityWithChangeTracker entity = (IEntityWithChangeTracker)entry.Entity; entity.SetChangeTracker(null); } } base.Dispose(disposing); }
// See IChangeTrackingStrategy documentation public void SetChangeTracker(IEntityChangeTracker changeTracker) { _entity.SetChangeTracker(changeTracker); }