diff --git a/Francesco.Recipes.World/Controller/ShoppingList/ShoppingListController.cs b/Francesco.Recipes.World/Controller/ShoppingList/ShoppingListController.cs index 8fe8fca..7557edd 100644 --- a/Francesco.Recipes.World/Controller/ShoppingList/ShoppingListController.cs +++ b/Francesco.Recipes.World/Controller/ShoppingList/ShoppingListController.cs @@ -60,10 +60,15 @@ return NotFound(); } + var recipeInAnyShoppingList = (await _shoppingListRepository.GetAllShoppingListsAsync()) + .SelectMany(sl => sl.RecipeShoppingList.Select(rsl => rsl.Recipe)) + .ToList(); + var viewModel = new ShoppingListDetailsViewModel { ShoppingList = shoppingList, RecipeCount = recipeCount, + RecipesInAnyShoppingList = recipeInAnyShoppingList, }; return View(viewModel);