public async Task <bool> EditContact(ContactEditDTO dto) { var rao = _mapper.Map <ContactEditRAO>(dto); if (await _contactRepository.EditContact(rao)) { return(true); } return(false); }
public async Task <IActionResult> EditContact([FromBody] ContactEditDTO contactEditDTO, int id) { try { var contact = mapper.Map <Contact>(contactEditDTO); var result = await contactManager.EditContact(id, contact); if (result == true) { return(NoContent()); } return(BadRequest()); } catch (Exception) { throw; } }