public ActionResult AddToCart(int productId) { var productToBeAdded = _productService.GetById(productId); var cart = _cardSessionService.GetCart(); _cartService.AddToCart(cart, productToBeAdded); _cardSessionService.SetCard(cart); TempData.Add("message", string.Format("{0} Ürün başarıyla eklendi.", productToBeAdded.ProductName)); return(RedirectToAction("Index", "Product")); }
public ViewViewComponentResult Invoke() { var model = new CartSummaryViewModel() { Cart = _cartSessionService.GetCart() }; return(View(model)); }