public async Task <IActionResult> PutCar(int id, Car car) { if (id != car.CarId) { return(BadRequest()); } _context.Entry(car).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CarExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutReservation(int id, Reservation reservation) { if (id != reservation.ID) { return(BadRequest()); } _context.Entry(reservation).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ReservationExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }