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; } }