Exemple #1
0
        public static List <RecipeViewModel> GetAllCurrentUserRecipesFromDB()
        {
            var database = new SQLiteDataService();

            database.Initialize();
            var recipeViewModels = database.GetAllCurrentUserRecipes(currentUser.Id)
                                   .Select(recipe =>
            {
                if (recipe.Id > recipeId)
                {
                    recipeId = recipe.Id;
                }
                return(new RecipeViewModel(recipe));
            }).ToList();

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