我有一個按此分組的物件串列:
Dim duplicates = test.GroupBy(Function(i) i.Total) _
.Where(Function(x) x.Count() > 1) _
.[Select](Function(x) x).ToList
現在我可以通過除錯器看到它??通過一個作為總屬性的鍵正確地對串列測驗的重復物件進行分組。
現在對于每個鍵值,我需要獲取物件,而不是對它們做一些事情(對于每個回圈)。我的問題是無論如何我都無法訪問主題。如果我嘗試投射,我總是會得到:Value of type List(Of IGrouping(Of Integer, myObject)) cannot be converted to List(Of myObject))
我如何訪問這些資料并對其進行操作?
uj5u.com熱心網友回復:
預期是錯誤的。切換到物件串列并更改了在沒有 linq 的情況下對 groupin 進行排序的方法。
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/503748.html
上一篇:嵌套中繼器源無法系結