public ActionResult AddCart() { //create an empty cart Cart cart = new Cart(); return View(cart); }
public ActionResult SaveCart(Cart cart) { carts.Add(cart); return View(cart); }
public ActionResult EditCart(int id) { // products.Add(product); ViewBag.Message = "Your application description page."; Cart cart = new Cart(); foreach (var find in carts) { if (find.Id == id) { cart.UserId = find.UserId; cart.Id = find.Id; carts.Remove(find); break; } } return View(cart); }