public async Task <IActionResult> PutDoctor(int id, Doctor doctor) { if (id != doctor.DoctorId) { return(BadRequest()); } _context.Entry(doctor).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DoctorExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutPatient(int id, Patient patient) { if (id != patient.PatientId) { return(BadRequest()); } _context.Entry(patient).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PatientExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public Booking PutBooking(int id, Booking booking) { _context.Entry(booking).State = EntityState.Modified; _context.SaveChangesAsync(); return(booking); }