Exemplo n.º 1
0
        public ActionResult Update(int id)
        {
            Athlete athlete = _athRepo.GetById((int)id);

            var teamsList = ItemListCreator.Teams(_teamRepo);

            teamsList.ElementAt(0).Selected = false;
            teamsList.Where(item => item.Text == athlete.TeamName).First().Selected = true;
            ViewBag.teamsList = teamsList;


            var sportsList = ItemListCreator.Sports();

            sportsList.Where(sport => sport.Text == athlete.Sport).First().Selected = true;
            sportsList.ElementAt(0).Selected = false;
            ViewBag.sportsList = sportsList;

            return(View(athlete));
        }