public IActionResult Index() { Preferences pref = new Preferences() { Cuisine = GetPreferredCuisine(), }; pref.Cuisines = new SelectList(recipeDAO.GetCuisines()); return(View(pref)); }
// Set all the SelectLists from the DAO, into the given ViewModel private void CreateSelectLists(RecipeVM vm) { vm.Cuisines = new SelectList(recipeDAO.GetCuisines()); vm.MealTypes = new SelectList(recipeDAO.GetMealTypes()); vm.Units = new SelectList(recipeDAO.GetUnits()); }