Ejemplo n.º 1
0
        public IActionResult AverageStock()
        {
            List <ShopItem> itemsList    = ListOfItems.GetItems();
            double          averageStock = itemsList.Average(i => i.StockQuantity);

            return(View(averageStock));
        }
Ejemplo n.º 2
0
        public IActionResult MyShop()
        {
            //ViewBag.items = ListOfItems.GetItems(); working same as line under (better solution)
            List <ShopItem> itemsList = ListOfItems.GetItems();

            return(View(itemsList));
        }