コード例 #1
0
        public SpecialistViewModel Update(SpecialistViewModel dto)
        {
            try
            {
                var entity = _specialistRepository.GetSingleById(dto.MESpecialistID.GetValueOrDefault());
                if (entity == null)
                {
                    throw new Exception("Object not found!");
                }
                entity.CopyPropertiesFrom(dto);

                _specialistRepository.Update(entity);
                _unitOfWork.Commit();

                return(Get(dto.MESpecialistID.GetValueOrDefault()));
            }
            catch (Exception ex)
            {
                _logService.Create(ex);
                throw ex;
            }
        }