public async Task <IActionResult> PutPatient(int id, Patient patient) { if (id != patient.Id) { return(BadRequest()); } _context.Entry(patient).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PatientExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }