public async Task <UpdateVisitDto> UpdateVisit(UpdateVisitDto updateVisitDto) { var visitToUpdate = _mapper.Map <Visit>(updateVisitDto); var updatedVisit = await _visitRepository.UpdateVisit(visitToUpdate); var result = _mapper.Map <UpdateVisitDto>(updatedVisit); return(result); }
public async Task <IActionResult> Update([FromBody] UpdateVisitDto visit) { if (!ModelState.IsValid) { return(BadRequest()); } var response = await _visitService.UpdateVisit(visit); if (response == null) { return(BadRequest()); } return(Ok(response)); }