我有兩個控制器我怎樣才能顯示在首頁/索引視圖MVCç#兩個的ActionResult
BloggsController:
//Last blogg from the database
public ActionResult LastBlogg()
{
var lastblogg = db.Bloggs.OrderByDescending(o => o.ID).Take(1);
return View(lastblogg);
}
DishesController:
//Last recipe from the database
public ActionResult LastRecipe()
{
var last = db.Dishes.OrderByDescending(o => o.ID).Take(1);
return View(last);
}
我想說明這樣做的結果在我的開始頁面上,Views/Home/index。
如果我把這個在我的HomeController:
//Last recipe from the database
public ActionResult Index()
{
var last = db.Dishes.OrderByDescending(o => o.ID).Take(1);
return View(last);
}
我可以顯示結果我的起始頁的配方,但我怎麼顯示blogg和配方上OM起始頁的兩種結果?