// // GET: /Season/ public ActionResult Index() { IList <Season> seasons = seasondao.GetAll(); ViewBag.Seasons = seasons; return(View()); }
public IEnumerable <SelectListItem> Seasons() { IList <SelectListItem> items = new List <SelectListItem>(); IList <Season> seasons = seasondao.GetAll(); foreach (Season s in seasons) { items.Add(new SelectListItem { Value = s.Id.ToString(), Text = s.Value }); } ; return(items); }