public async Task <List <FoodItem> > GetOrderedFoodItemsAsync(string filterForTerm) { List <FoodItem> foodItems; if (filterForTerm == null) { foodItems = await FoodItems .OrderBy(v => v.Name) .ToListAsync(); } else { filterForTerm = filterForTerm.ToLower(); foodItems = await FoodItems .Where(v => v.Name.ToLower().Contains(filterForTerm)) .OrderBy(v => v.Name) .ToListAsync(); } return(foodItems); }