0
enter code here
想從主列表中刪除項目,但給出一個錯誤「無法轉換<ExceptIterator>d__99'1[
類型的對象的IEqualityComparer(的對象)相交或不除工作
Public Class FieldCollectionItemCompare
Implements System.Collections.Generic.IEqualityComparer(Of FieldCollectionItem)
Public Shadows Function Equals(ByVal x As FieldCollectionItem, ByVal y As FieldCollectionItem) As Boolean Implements System.Collections.Generic.IEqualityComparer(Of FieldCollectionItem).Equals
If x.UniqueID = y.UniqueID Then
Equals = True
Else
Equals = False
End If
End Function
Public Overloads Function GetHashCode(ByVal obj As FieldCollectionItem) As Integer Implements System.Collections.Generic.IEqualityComparer(Of FieldCollectionItem).GetHashCode
GetHashCode = obj.UniqueID + obj.UniqueID
End Function
End Class
...這裏是什麼我做
FieldCollectionToProcessList = FieldCollectionToProcessList.Intersect(FieldCollectionRejected, New FieldCollectionItemCompare)
FieldCollectionToProcessList = FieldCollectionToProcessList.Intersect(FieldCollectionAccepted, New FieldCollectionItemCompare)
...所有的單子都是As Generic.List(Of FieldCollectionItem)
我需要檢查比較列表數是否爲空嗎? –