public void Save <TEntity> (TEntity entity, bool orUpdate = true) where TEntity : IDomainObject { if (!orUpdate) { throw new NotImplementedException("orUpdate = false не реализовано для ChildUnitOfWork"); } if (RootObject.Equals(entity)) { if (externalRootVersion == null) { externalRootVersion = Root; } else { ObjectCloner.FieldsCopy(Root, ref externalRootVersion); } ObjectToSave.Add(externalRootVersion); Commit(); OrmMain.DelayedNotifyObjectUpdated(ParentUoW.RootObject, entity); } else { ObjectToSave.Add(entity); OrmMain.DelayedNotifyObjectUpdated(RootObject, entity); } }
public bool Save() { var valid = new QSValidator <FreeRentEquipment> (subject); if (valid.RunDlgIfNotValid((Gtk.Window) this.Toplevel)) { return(false); } subject.IsNew = false; OrmMain.DelayedNotifyObjectUpdated(ParentReference.ParentObject, subject); return(true); }