// zobrazení stránky Bestiary public async Task <ActionResult> Bestiary() { ViewBag.Message = "Bestiary page."; List <BeastTypeDO> beastType = await BeastTypeDO.GetBeastTypeAsync(); List <BeastsDO> bestiary = await BeastsDO.GetBeastsAsync(beastType[0].Idbeasttype); ViewBag.beastType = beastType .Select(x => new SelectListItem() { Text = x.Name, Value = x.Idbeasttype.ToString() }) .ToList(); ViewBag.Bestiary = bestiary; BeastModel model = new BeastModel(); model.BeastTypeID = beastType[0].Idbeasttype; return(View(model)); }
public async Task <ActionResult> Bestiary(BeastModel model) { List <BeastTypeDO> beastType = await BeastTypeDO.GetBeastTypeAsync(); List <BeastsDO> bestiary = await BeastsDO.GetBeastsAsync(model.BeastTypeID); ViewBag.beastType = beastType .Select(x => new SelectListItem() { Text = x.Name, Value = x.Idbeasttype.ToString() }) .ToList(); ViewBag.Bestiary = bestiary; return(View(model)); }