コード例 #1
0
        private List <SelectListItem> GetSportListItems()
        {
            var items = new List <SelectListItem>();

            foreach (var sport in LeagueManager.GetAllSports().ToList())
            {
                items.Add(new SelectListItem {
                    Text = sport.DisplayName, Value = sport.SportId
                });
            }

            return(items);
        }