public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Username,Password")] User user) { if (id != user.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(user); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserExists(user.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(user)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,UseStatus")] Table table) { if (id != table.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(table); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TableExists(table.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(table)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Price,Picture")] MenuItem menuItem) { if (id != menuItem.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(menuItem); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MenuItemExists(menuItem.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(menuItem)); }