简体   繁体   English

使用LINQ从嵌套字典中获取值。 词典的值是列表的列表

[英]get values from nested Dictionary using LINQ. Values of Dictionary are list of lists

How to get values from nested Dictionary using LINQ. 如何使用LINQ从嵌套字典中获取值。 Keys in the Dictionary are integer. 字典中的键是整数。 Values of Dictionary are list of lists. 词典的值是列表的列表。 Seconday level list is a list of array holding integer value. Seconday级别列表是包含整数值的数组的列表。 Thanks in advance. 提前致谢。

Dictionary<int, List<List<int[]>>> dictionary = ...
var values = dictionary.Values.SelectMany(x => x.SelectMany(y => y.SelectMany(z => z));

Edit : Didn't realize it was a list of lists, so modified to account for that. 编辑 :没意识到这是一个列表列表,所以进行了修改以说明这一点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM