Ejemplo n.º 1
0
        public ViewResult Index()
        {
            var items = cart.GetShoppingCartItems();

            cart.ShoppingCartItems = items;

            var shoppingCartModel = new SoppingCartModel
            {
                Cart = cart,
                ShoppingCartTotal = cart.GetShoppingCartTotal()
            };

            return(View(shoppingCartModel));
        }
        public IViewComponentResult Invoke()
        {
            var items = cart.GetShoppingCartItems();

            cart.ShoppingCartItems = items;

            var shoppingCartModel = new SoppingCartModel
            {
                Cart = cart,
                ShoppingCartTotal = cart.GetShoppingCartTotal()
            };

            return(View(shoppingCartModel));
        }