public async Task <IActionResult> PutPatient(int id, PatientUpdateDto patient) { if (id != patient.Id) { return(BadRequest()); } try { var item = _mapper.Map <Patient>(patient); await _repository.Update(item); } catch (DbUpdateConcurrencyException) { var t = await PatientExists(id); if (!t) { return(NotFound()); } else { throw; } } return(NoContent()); }