public void OnGet()
 {
     if (Vegetarian == false)
     {
         Recipes = rr.GetAllRecipesWithIngredients();
     }
     else
     {
         Recipes = rr.GetAllRecipesWithIngredients().Where(r => r.Vegetarian == true).ToList();
     }
 }
Beispiel #2
0
        public void OnGet()
        {
            FilterType = FilterType.ToLower();

            if (FilterType != "all")
            {
                Recipes = recipeRepository.GetAllRecipesWithIngredients();
                if (FilterType == "nonvegan")
                {
                    Recipes.RemoveAll(x => x.IsVegetarian);
                }
                else if (FilterType == "vegan")
                {
                    Recipes.RemoveAll(x => !x.IsVegetarian);
                }
                return;
            }
            Recipes = recipeRepository.GetAllRecipes();
        }
 public void OnGet()
 {
     Ingredients = new SelectList(ir.GetAllIngredients(), "Id", "Name");
     Recipes     = rr.GetAllRecipesWithIngredients();
 }