我有以下列表键值对
var countryList = new List<KeyValuePair<string,int>>();
然后我从数据库中填充一个while循环,就像这样
countryList.Add(new KeyValuePair<string, int>("cname",1));
然后我想使用 linq 查询它并同时订购它,我有这个
var lst = from s in countryList
orderby s.[0]
select s;
你可以猜到它不起作用,我知道为什么它是 s。[0] 但有人能告诉我正确的语法是什么吗?
谢谢