private void ValidateContract(UpdateSkillTypeContract contract) { try { _updateSkillContractValidator.ValidateAndThrow(contract, $"{ValidatorConstants.RULESET_DEFAULT}"); } catch (ValidationException ex) { throw new CreateContractInvalidException(ex.ToListOfMessages()); } }
public void Update(UpdateSkillTypeContract contract) { _log.LogInformation($"Validating contract {contract.Name}"); ValidateContract(contract); ValidateExistence(contract.Id, contract.Name); _log.LogInformation($"Mapping contract {contract.Name}"); var skillType = _mapper.Map <SkillType>(contract); var updatedSkill = _skillTypeRepository.Update(skillType); _log.LogInformation($"Complete for {contract.Name}"); _unitOfWork.Complete(); }