예제 #1
0
        public static List <Recipe> GetMealsRecipes(List <Meal> listOfMeals)
        {
            var database = new SQLiteDataService();

            database.Initialize();
            var recipesByMealsList = listOfMeals.SelectMany(meal => database.GetRecipesByMeal(meal.Id)).ToList();

            database.Close();
            return(recipesByMealsList);
        }
예제 #2
0
        public static List <RecipeViewModel> GetMealRecipes(int mealId)
        {
            var database = new SQLiteDataService();

            database.Initialize();
            var recipeByMealList = database.GetRecipesByMeal(mealId).Select(recipe => new RecipeViewModel(recipe)).ToList();

            database.Close();
            return(recipeByMealList);
        }