public async Task <IActionResult> Edit(string id, [Bind("UserName,Password,Role")] UserInfo userInfo) { if (id != userInfo.UserName) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(userInfo); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserInfoExists(userInfo.UserName)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(userInfo)); }
public async Task <IActionResult> Edit(int id, [Bind("ShoppingCartItemId,Amount,ShoppingCartId")] ShoppingCartItem shoppingCartItem) { if (id != shoppingCartItem.ShoppingCartItemId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(shoppingCartItem); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ShoppingCartItemExists(shoppingCartItem.ShoppingCartItemId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(shoppingCartItem)); }
public void Update(PizzaCust pizza) { _context.Update(pizza); }