public IViewComponentResult Invoke() { var items = _shoppingcart.GetShoppingCartItems(); _shoppingcart.ShoppingCartItems = items; var shoppingCartViewModel = new ShoppingCartViewModel { ShopingCart = _shoppingcart, ShoppingCartTotal = _shoppingcart.GetShoppingCartTotal() }; return(View(shoppingCartViewModel)); }
//[Authorize] public ViewResult Index() { var items = _shoppingCart.GetShoppingCartItems(); _shoppingCart.ShoppingCartItems = items; var shoppingCartViewModel = new ShoppingCartViewModel { ShopingCart = _shoppingCart, ShoppingCartTotal = _shoppingCart.GetShoppingCartTotal() }; return(View(shoppingCartViewModel)); }