0
我有一個類,它被保存在一個列表中的字典裏面,像這樣: -轉換表(表(類)),以列表(類)
Public Class MyClass
Public something As Integer
Public something_else As Double
End Class
Dim my_dictionary As Dictionary (Of Integer, List (Of MyClass))
然後我需要提取其中一些列表將其轉換爲單個列表。我可以提取必要的名單如下: -
Dim list_of_lists As List (Of List (Of MyClass)) =
From dict_item As KeyValuePair (Of Integer, List (Of MyClass) In my_dictionary
Where dict_item.Key < some_value
Select dict_item.Value).ToList
,但不能再將其換算成
Dim list_of_items As List (Of MyClass) = ...er...
我有一個看問題here和here使用SelectMany
,但我不能讓任何使用SelectMany
進行編譯的東西,以及C#的用法(和解釋)都有點簡潔。
使用
(From one_list In list_of_lists
Select one_list.FindAll(Function(x) True)).ToList
只是創建列表的另一個列表。
有誰知道如何做到這一點?
看那['SelectMany'](https://msdn.microsoft.com/en-us/library/system.linq.enumerable.selectmany( v = VS.100)的.aspx)。 –
他在問題中已經提到了「SelectMany」。所以他有執行它的問題。 –