Пример #1
0
 private void ValidateContract(UpdateSkillTypeContract contract)
 {
     try
     {
         _updateSkillContractValidator.ValidateAndThrow(contract,
                                                        $"{ValidatorConstants.RULESET_DEFAULT}");
     }
     catch (ValidationException ex)
     {
         throw new CreateContractInvalidException(ex.ToListOfMessages());
     }
 }
Пример #2
0
        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();
        }