Пример #1
0
 public async Task<ContactCMS> AddDefault(ContactCMS model)
 {
     try
     {
         var savedModel = _unitOfWork.ContactCMSRepository.Add(model);
         await _unitOfWork.SaveChangesAsync();
         return savedModel;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #2
0
 public async Task<ContactCMS> UpdateContactConfiguration(ContactCMS contactCMS)
 {
     try
     {
         if (contactCMS == null) throw new InvalidParameterException();
         _unitOfWork.ContactCMSRepository.Update(contactCMS);
         await _unitOfWork.SaveChangesAsync();
         return contactCMS;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #3
0
        public async Task <ContactCMSModel> AddDefault(ContactCMSModel ContactModel)
        {
            try
            {
                ContactCMS model      = _mapper.Map <ContactCMS>(ContactModel);
                ContactCMS addedModel = await _contactCMSManager.AddDefault(model);

                ContactCMSModel savedModel = _mapper.Map <ContactCMSModel>(addedModel);
                return(savedModel);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }