public async Task <IActionResult> Edit(long id, [Bind("ExpectedGuestId,Date,RoomNumber,Adults,Children")] ExpectedGuest expectedGuest) { if (id != expectedGuest.ExpectedGuestId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(expectedGuest); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ExpectedGuestExists(expectedGuest.ExpectedGuestId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(expectedGuest)); }
public async Task <IActionResult> Create([Bind("ExpectedGuestId,Date,RoomNumber,Adults,Children")] ExpectedGuest expectedGuest) { if (ModelState.IsValid) { _context.Add(expectedGuest); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(expectedGuest)); }