public ActionResult FillDropDwon() { fantasyEntities demoContext = new fantasyEntities(); Teams student = new Teams(); student.Team_Names = (from s in demoContext.footballteam select new SelectListItem() { Text = s.teamName, Value = s.idFootballTeam.ToString() }).ToList<SelectListItem>(); return View(student); }
// // GET: /Admin/ public ActionResult Index() { fantasyEntities demoContext = new fantasyEntities(); Teams student = new Teams(); //fe.user.Where(a => a.email.Equals(model.UserName) && a.password.Equals(model.Password)).FirstOrDefault(); //student.Team_Names = (from s in demoContext.footballteam // select new SelectListItem() // { // Text = s.teamName, // Value = Convert.ToString(s.idFootballTeam) // }).ToList<SelectListItem>(); student.Team_Names = demoContext.footballteam.Select(data => new SelectListItem { Text = data.teamName, Value = "2" }).ToList<SelectListItem>(); return View(student); // return View(); }