Пример #1
0
        public virtual async Task UpdateContact(CreateContactInput input)
        {
            var contact = await _CompanyContactRespository.GetAsync(input.Id);

            ObjectMapper.Map(input, contact);
            await _CompanyContactRespository.UpdateAsync(contact);
        }
Пример #2
0
 public async Task CreateOrUpdateContact(CreateContactInput input)
 {
     if (input.Id == 0)
     {
         await CraeteContact(input);
     }
     else
     {
         await UpdateContact(input);
     }
 }
Пример #3
0
 public OutputBase CreateContact(CreateContactInput input)
 {
     try
     {
         _contactRepository.Insert(Mapper.Map <Contact>(input));
         return(new OutputBase {
             Message = "Contact saved", Success = true
         });
     }
     catch
     {
         return(new OutputBase {
             Message = "Contact not saved", Success = false
         });
     }
 }
Пример #4
0
 public virtual async Task CraeteContact(CreateContactInput input)
 {
     var contact = input.MapTo <CompanyContact>();
     await _CompanyContactRespository.InsertAsync(contact);
 }