我已经创建了IEnumerable的单个对象 想让它的字典类型对象来处理键和值。如何从C#中的CultureTypes对象获取pair值?
想要从文化中提取货币符号和名称。
IEnumerable<string> currencySymbols = CultureInfo.GetCultures(CultureTypes.SpecificCultures) //Only specific cultures contain region information
.Select(x => (new RegionInfo(x.LCID)).ISOCurrencySymbol)
.Distinct()
.OrderBy(x => x);
foreach(string s in currencySymbols)
{
CurrencyTable tbl = new CurrencyTable();
tbl.Iso = s;
tbl.Name = s;
}
我要像下面
IEnumerable<string,string>
怎么可能呢? CurrencyTable是包含ID | Iso | Name
类提起
像'的IEnumerable <字符串,字符串>甲事情'不C#存在。你想达到什么目的?你想按名称访问'Dictionary',string,string>吗? – ChriPf
我想获得所有的ISO和货币名称存储在数据库中.. –
看到第一个答案http://stackoverflow.com/questions/16109121/data-member-validation-iso-4217-currency-and-639-1语言想要获得名称的iso并且想要存储在数据库中。 –