public async Task <IActionResult> Edit(int id, [Bind("Id,ProductName,Price,Photo")] ProductTbl productTbl) { if (id != productTbl.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(productTbl); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductTblExists(productTbl.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(productTbl)); }
public void UpdateCart(Cart cart) { _context.Update(cart); _context.SaveChanges(); }