Hi all!
I need to check if an object with equal property value(CustomObject.Key) exist in my custom list
In a List(Of String) i would do it like this
Public Class StringList
Inherits List(Of String)
Public Overloads Sub Add(ByVal s As String)
If Not Me.Contains(s) Then
MyBase.Add(s)
End If
End Sub
End Class
How can i do the same Contains check on my CustomObject.Key ?
Public Class CustomList
Inherits List(Of CustomObject)
Public Overloads Sub Add(ByVal o As CustomObject)
' If Not Me.Contains[an object with the same Key as the one im trying to add]?
MyBase.Add(o)
' End If
End Sub
End Class
Public Class CustomObject
Public Key As String
Public Num As Integer
Public Ok As Boolean
End Class
Hope you can help :)