public IActionResult Index(string cuisine) { if (cuisine == null || cuisine.Length == 0) { // Calls the base class method that gets the user's preferrred cuisine from session state cuisine = GetPreferredCuisine(); } else { // Calls the base class method that sets the user's preferrred cuisine into session state SetPreferredCuisine(cuisine); } // Call the DAO to get Recipes, and pass the list into the view return(View(recipeDAO.GetRecipes(cuisine))); }
public IActionResult Index() { string cuisine = GetPreferredCuisine(); return(View(recipeDAO.GetRecipes(cuisine))); }
public IActionResult Index() { IList <Recipe> recipes = recipeDAO.GetRecipes(GetPreferredCuisine()); return(View(recipes)); }
public List <Recipe> GetRecipes() { return(recipeDAO.GetRecipes()); }