public ActionResult IncreaseQuantity(OrderGridItem product) { foreach (var it in items) { if (it.Name == product.Name) { it.Quantity++; break; } } return(View("Index", items)); }
public ActionResult Delete(OrderGridItem product) { OrderGridItem toDelete = null; foreach (var it in items) { if (it.Name == product.Name) { toDelete = it; } } if (toDelete != null) { items.Remove(toDelete); } return(View("Index", items)); }