我旁边的字典在C#LINQ选择C#字典
Dictionary<string, object> subDictioanry = new Dictionary<string, object>();
List<Dictionary<string, string>> subList = new List<Dictionary<string, string>>();
subList.Add(new Dictionary<string, string>(){
{"valueLink", "link1"},
{"valueTitle","title1"}
});
subList.Add(new Dictionary<string, string>(){
{"valueLink", "link2"},
{"valueTitle","title2"}
});
subList.Add(new Dictionary<string, string>(){
{"valueLink", "link3"},
{"valueTitle","title3"}
});
subDictioanry.Add("title", "title");
subDictioanry.Add("name", "name");
subDictioanry.Add("fieldname1", subList);
Dictionary<string, object> exitDictionary = new Dictionary<string, object>();
exitDictionary.Add("first", subDictioanry);
exitDictionary.Add("second", subDictioanry);
是否有可能让所有“valueTitle”与LINQ的帮助下选择?
UPDATE: 对不起,我应该是第一个写 - 我需要得到源于exitDictionary,而不是从子列表
如果您使用类而不是字典,这将更容易推理。只是说。 – millimoose