我如何改进此代码:
Dim count As Integer = 0
Dim myDictionary As Dictionary(Of Long, List(Of Proposal)) = list.GroupBy(Function(x) x.BankAccountId).ToDictionary(Function(g) g.Key, Function(a) a.ToList)
For Each bAccId As Long In myDictionary.Keys
Dim currencies As Dictionary(Of String, List(Of Proposal)) = myDictionary(bAccId).GroupBy(Function(x) x.Currency).ToDictionary(Function(g) g.Key, Function(a) a.ToList)
For Each c As String In currencies.Keys
Dim execDates2 As Dictionary(Of Date, List(Of Proposal)) = currencies(c).GroupBy(Function(x) x.ExecutionTime).ToDictionary(Function(g) g.Key, Function(a) a.ToList)
count += execDates2.Keys.Count
Next
Next