public async Task <ActionResult> Groceries() { IEnumerable <Fruit> sortedGroceries = default; var groceries = await _inventoryDataProvider.Retrieve(); if (groceries.Any()) { sortedGroceries = groceries.OrderByDescending(x => x.UpdatedDate); } return(View(sortedGroceries)); }
public async Task <ActionResult> Groceries() { IEnumerable <Fruit> sortedGroceries = default; // Get the Groceries from Inventory var groceries = await _inventoryDataProvider.Retrieve(); // If there exists Groceries, sort them by descending order if (groceries.Any()) { sortedGroceries = groceries.OrderByDescending(x => x.UpdatedDate); } // Send the sorted Groceries to view return(View(sortedGroceries)); }
public async Task <ActionResult> Groceries() { var groceries = await _inventoryDataProvider.Retrieve(); return(View(groceries)); }