Ejemplo n.º 1
0
        public static Country GetCountryByISO(string countryIsoCode)
        {
            if (string.IsNullOrWhiteSpace(countryIsoCode))
            {
                return(null);
            }

            return(COUNTRIES.FirstOrDefault(c => c.Code == countryIsoCode));
        }
Ejemplo n.º 2
0
 public static Country[] GetCountries()
 {
     return(COUNTRIES
            .Split(new[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries)
            .Select((country, index) => new Country {
         id = index,
         name = country
     }).ToArray());
 }