public async Task <IActionResult> PutChef(int id, Chef chef) { if (id != chef.Id) { return(BadRequest()); } _context.Entry(chef).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ChefExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutPhoneNumber(int id, PhoneNumber phoneNumber) { if (id != phoneNumber.Id) { return(BadRequest()); } _context.Entry(phoneNumber).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PhoneNumberExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutDaySchedule(int id, DaySchedule daySchedule) { if (id != daySchedule.Id) { return(BadRequest()); } _context.Entry(daySchedule).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DayScheduleExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task PostReservationAsync(Reservation res) { _context.Add(res); await _context.SaveChangesAsync(); }