public IActionResult AverageStock() { List <ShopItem> itemsList = ListOfItems.GetItems(); double averageStock = itemsList.Average(i => i.StockQuantity); return(View(averageStock)); }
public IActionResult MyShop() { //ViewBag.items = ListOfItems.GetItems(); working same as line under (better solution) List <ShopItem> itemsList = ListOfItems.GetItems(); return(View(itemsList)); }