Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }