示例#1
0
        public async Task <IActionResult> Index()
        {
            var countries = new List <Dropdown>();

            // Let's get all countries that we need for a DropDownList
            countries = await _liveScoreAPI.GetCountries();

            // Inserting select list item in list
            var empty = countries.Find(a => a.Key == "0");

            if (empty == null)
            {
                countries.Insert(0, new Dropdown {
                    Key = "0", Value = "-- Wybierz kraj --"
                });
            }
            ViewBag.ListOfCountries = countries;
            var model = new ChooseTeamViewModel();

            model.TeamResult = new TeamCheckResult();
            model.TeamResult.MatchResults = new List <MatchResult>();
            return(View(model));
        }
 public ChooseTeam()
 {
     InitializeComponent();
     DataContext = new ChooseTeamViewModel(this);
 }