/// <summary> /// Accept all changes in all entities associated with <paramref name="entity"/> /// </summary> /// <param name="entity">Root entity</param> public static void AcceptAllChanges(this IObjectWithChangeTracker entity) { using (ChangeTrackerIterator iterator = ChangeTrackerIterator.Create(entity)) iterator.Execute(ste => ste.AcceptChanges()); }
/// <summary> /// Stop tracking in all entities associated with <paramref name="entity"/> /// </summary> /// <param name="entity">Root entity</param> public static void StopTrackingAll(this IObjectWithChangeTracker entity) { using (ChangeTrackerIterator iterator = ChangeTrackerIterator.Create(entity)) iterator.Execute(ste => ste.StopTracking()); }