public async Task <IActionResult> Create([Bind("DishId,DishName,DishDetails")] Dishes dishes) { if (ModelState.IsValid) { _context.Add(dishes); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(dishes)); }
public async Task <IActionResult> Create([Bind("CustomerId,FirstName,LastName,Email,DishName")] Customers customers) { if (ModelState.IsValid) { _context.Add(customers); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["DishName"] = new SelectList(_context.Dishes, "DishName", "DishName", customers.DishName); return(View(customers)); }
public async Task <IActionResult> Create([Bind("ReservationId,Date,Email,Table")] Reservations reservations) { if (ModelState.IsValid) { _context.Add(reservations); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["Email"] = new SelectList(_context.Customers, "Email", "Email", reservations.Email); return(View(reservations)); }