Esempio n. 1
0
      public RedirectToActionResult RemoveFromCurrentCart(int productId,
                                                          string returnUrl)
      {
          Product product = repository.Products
                            .FirstOrDefault(p => p.Id == productId);

          if (product != null)
          {
              CurrentCart currentCart = GetCurrentCart();
              currentCart.RemoveLine(product);
              SaveCurrentCart(currentCart);
          }
          return(RedirectToAction("Index", new { returnUrl }));
      }