Пример #1
0
        public ViewResult Index()
        {
            var items = _shoppingCart.GetShoppingCartItems();

            _shoppingCart.CartItems = items;

            var shoppingCartViewModel = new ShoppingCartVModel
            {
                ShoppingCart      = _shoppingCart,
                ShoppingCartTotal = _shoppingCart.GetShoppingCartTotal()
            };

            return(View(shoppingCartViewModel));
        }
        /// <summary>
        /// metoda do przekazania oraz wyświetlaniadanych
        /// </summary>
        /// <returns>zwraca dane które odpowiadają logicę w danej metodzie</returns>
        public IViewComponentResult Invoke()
        {
            var items = _shoppingCart.GetShoppingCartItems();

            _shoppingCart.CartItems = items;

            var shoppingCartViewModel = new ShoppingCartVModel
            {
                ShoppingCart      = _shoppingCart,
                ShoppingCartTotal = _shoppingCart.GetShoppingCartTotal(),
                //Genre = _genre.Genres.ToList()
            };

            return(View("Default", shoppingCartViewModel));
        }
Пример #3
0
 public IActionResult BasicData1(ShoppingCartVModel shoppingCart)
 {
     return(View(shoppingCart));
 }