public async Task <IActionResult> PutReservation(int id, Reservation reservation) { if (id != reservation.ReservationId) { return(BadRequest()); } _context.Entry(reservation).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ReservationExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutClient(int id, Client client) { if (id != client.ClientId) { return(BadRequest()); } _context.Entry(client).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ClientExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }