Exemple #1
0
        private void GenerateCountryListToViewBag()
        {
            var countrySelect = new List <SelectListItem>(200)
            {
                new SelectListItem("Select a Country", Constants.UkCountryValue, true, true)
            };

            var mappedCountries = _countryList.Select(x => new SelectListItem(x, x));

            countrySelect.AddRange(mappedCountries);

            ViewBag.CountryList = countrySelect;
        }