public async Task <PersonResponseDomainModel> Put(PersonUpdateDomainModel person) { var entity = _mapper.Map <PersonEntity>(person); var result = await _repository.UpdateAsync(entity); return(_mapper.Map <PersonResponseDomainModel>(result)); }
public async Task <ActionResult> Put([FromBody] PersonUpdateDomainModel person) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } try { var result = await _service.Put(person); if (result != null) { return(Ok(result)); } else { return(BadRequest()); } } catch (ArgumentException e) { return(StatusCode((int)HttpStatusCode.InternalServerError, e.Message)); } }