public NccPage Update(NccPage entity) { var oldEntity = _entityRepository.Get(entity.Id); if (oldEntity != null) { oldEntity.ModificationDate = DateTime.Now; oldEntity.ModifyBy = BaseModel.GetCurrentUserId(); using (var txn = _entityRepository.BeginTransaction()) { CopyNewData(entity, oldEntity); _entityRepository.Edit(oldEntity); _entityRepository.SaveChange(); txn.Commit(); } } return(entity); }
public NccPage Update(NccPage entity) { var oldEntity = _entityRepository.Get(entity.Id, false, new List <string> { "Parent", "PageDetails" }); if (oldEntity != null) { oldEntity.ModificationDate = DateTime.Now; oldEntity.ModifyBy = GlobalContext.GetCurrentUserId(); using (var txn = _entityRepository.BeginTransaction()) { CopyNewData(entity, oldEntity); _entityRepository.Edit(oldEntity); _entityRepository.SaveChange(); txn.Commit(); } } return(entity); }