enter code here
想要从主列表中删除项目,但给出错误“无法转换类型的对象<ExceptIterator>d__99'1[
”
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)