public async Task <IActionResult> Edit(int id, [Bind("UserId,Fname,Lname,Email,Pass,Wallet")] Users users) { if (id != users.UserId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(users); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UsersExists(users.UserId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(users)); }
public async Task <IActionResult> Edit(int id, [Bind("ItemId,ItemDesc,Quantity,Price")] Items items) { if (id != items.ItemId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(items); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ItemsExists(items.ItemId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(items)); }