public IActionResult Index() { //var model = new Recipe { id = 1, Name = "Fettucini Alfredo" }; //var model = _recipeData.GetAll(); var model = new HomeIndexViewModel(); model.Recipes = _recipeData.GetAll(); model.CurrentMessage = _greeter.GetMessageofTheDay(); return(View(model)); }
// GET: HotDrinks public ActionResult Index() { var model = db.GetAll(); return(View(model)); }
public void OnGet() { Recipes = recipeData.GetAll().Select(x => new RecipeModel { RecipeId = x.Id, CategoryName = this.categoryData.GetById(x.CategoryId)?.Name, RecipeName = x.Name }).OrderBy(x => x.CategoryName).ThenBy(x => x.RecipeName); }