Пример #1
0
        public void Update(UpdateCompanyCalendarContract contract)
        {
            ValidateContract(contract);

            var companyCalendar = _mapper.Map <CompanyCalendar>(contract);

            var updatedCompanyCalendar = _companyCalendarRepository.Update(companyCalendar);

            this.AddModelToGoogleCalendar(companyCalendar);

            _unitOfWork.Complete();
        }
Пример #2
0
 private void ValidateContract(UpdateCompanyCalendarContract contract)
 {
     try
     {
         _updateCompanyCalendarContractValidator.ValidateAndThrow(contract,
                                                                  $"{ValidatorConstants.RULESET_DEFAULT}");
     }
     catch (ValidationException ex)
     {
         throw new CreateContractInvalidException(ex.ToListOfMessages());
     }
 }