/// <summary> /// Resets the object's state to unchanged by accepting the modifications. /// </summary> public void AcceptChanges() { OnAcceptingChanges(); // order of the following two operations is important // to keep the change tracking service in a consistent state if (ChangeTrackingService != null) { ChangeTrackingService.Remove(this); } // reset our own state IsChanged = false; OnAcceptChanges(); }