public NccCategory Update(NccCategory entity) { var oldEntity = _entityRepository.Get(entity.Id); if (oldEntity != null) { using (var txn = _entityRepository.BeginTransaction()) { CopyNewData(oldEntity, entity); _entityRepository.Edit(oldEntity); _entityRepository.SaveChange(); txn.Commit(); } } return(entity); }
public NccCategory Update(NccCategory entity) { var oldEntity = _entityRepository.Get(entity.Id, false, new List <string>() { "CategoryDetails", "Parent" }); if (oldEntity != null) { using (var txn = _entityRepository.BeginTransaction()) { CopyNewData(entity, oldEntity); _entityRepository.Edit(oldEntity); _entityRepository.SaveChange(); txn.Commit(); } } return(entity); }