public override NccMenu Update(NccMenu entity) { var oldEntity = _entityRepository.Get(entity.Id); if (oldEntity != null) { RecursiveLoad(oldEntity); for (var i = 0; i < oldEntity.MenuItems.Count; i++) { RecursiveNccMenuItemDelete(oldEntity.MenuItems[i]); } _menuItemRepository.SaveChange(); oldEntity = _entityRepository.Get(entity.Id); using (var txn = _entityRepository.BeginTransaction()) { CopyNewData(entity, oldEntity); _entityRepository.Edit(oldEntity); _entityRepository.SaveChange(); txn.Commit(); } } return(entity); }
public NccMenu Get(long entityId, bool isAsNoTracking = false) { return(_entityRepository.Get(entityId)); }
public NccMenu Get(long entityId) { return(_entityRepository.Get(entityId)); }