I'm trying to get RegionInfo
object by the country name. I've come up with this code:
var regions = CultureInfo.GetCultures(CultureTypes.SpecificCultures).Select(x => new RegionInfo(x.LCID));
var regionInfo = regions.FirstOrDefault(region => region.EnglishName.Contains(englishCountryName));
and it works fine on my machine. But when I deployed it on Azure App Service it returns null
for Czechia.
So I tested it:
//My machine
new RegionInfo(1029).EnglishName //returns Czechia
//Azure
new RegionInfo(1029).EnglishName //returns Czech Republic
As it turned out, Czech Republic changed it's name in 2016 so why Azure displays "old" name? How to make this solution culture-independent?