public static PostalCodesCities GetPostalCodesCities(string countryCode) { List <PostalCodeData> postalCodeArray = new List <PostalCodeData>(); List <CityData> cityArray = new List <CityData>(); List <GeographyData> geographyArray = new List <GeographyData>(); PostalCodes codes = PostalCodes.ForCountry(countryCode); Country country = Country.FromCode(countryCode); int maxPostalCodeLength = 0; foreach (PostalCode code in codes) { PostalCodeData dataPoint = new PostalCodeData { Code = code.PostalCode, CityId = code.CityId }; if (code.PostalCode.Length > maxPostalCodeLength) { maxPostalCodeLength = code.PostalCode.Length; } postalCodeArray.Add(dataPoint); } Cities cities = Cities.ForCountry(countryCode); foreach (City city in cities) { CityData dataPoint = new CityData { Id = city.Identity, Name = city.Name, GeographyId = city.GeographyId }; cityArray.Add(dataPoint); } Geographies geographies = Country.FromCode(countryCode).Geography.ThisAndBelow(); foreach (Geography geography in geographies) { GeographyData dataPoint = new GeographyData { Id = geography.Identity, Name = geography.Name }; geographyArray.Add(dataPoint); } PostalCodesCities result = new PostalCodesCities { PostalCodes = postalCodeArray.ToArray(), CityNames = cityArray.ToArray(), Geographies = geographyArray.ToArray(), PostalCodeLength = country.PostalCodeLength, PostalCodeLengthCheck = maxPostalCodeLength }; return(result); }