2
一鍵我有一個集合如下返回字典的子集的複雜類型與LINQ的
Private _bankRates As Dictionary(Of RateSourceBank.Key, RateSourceBank)
哪裏RateSourceBank.Key簡直是
Public Class Key
Public RateType As String
Public EffectiveDate As DateTime
End Class
我怎樣才能檢索到的子集_bankRates每個RateType有多個EffectiveDate?
不幸的是,我發現所有類似的例子都是用C#編寫的,而我對LINQ的翻譯比較簡單,尤其是對於語法組來說。下面
Dim ratesWithDuplicates = From rates In _bankRates
Group rates By rates.Key.RateType
Into grp()
Where grp.Count > 1
查詢我收到錯誤:
Definition of method 'grp' is not accessible in this context