public virtual async Task UpdateContact(CreateContactInput input) { var contact = await _CompanyContactRespository.GetAsync(input.Id); ObjectMapper.Map(input, contact); await _CompanyContactRespository.UpdateAsync(contact); }
public async Task CreateOrUpdateContact(CreateContactInput input) { if (input.Id == 0) { await CraeteContact(input); } else { await UpdateContact(input); } }
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 }); } }
public virtual async Task CraeteContact(CreateContactInput input) { var contact = input.MapTo <CompanyContact>(); await _CompanyContactRespository.InsertAsync(contact); }