public async Task <IActionResult> Edit(int id, [Bind("ID,Category,Drink")] drinkList drinkList) { if (id != drinkList.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(drinkList); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!drinkListExists(drinkList.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } return(View(drinkList)); }
public async Task <IActionResult> Create([Bind("ID,Category,Drink")] drinkList drinkList) { if (ModelState.IsValid) { _context.Add(drinkList); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(drinkList)); }