Imports System.Collections.Generic
Implements IEquatable(Of Dupa)
Public Property ItemId As Integer
Public Property Name As String
Public Function Equals1(other As Dupa) As Boolean Implements IEquatable(Of Dupa).Equals
Console.WriteLine("Hitting " & ItemId & " other: " & other.ItemId)
If other Is Nothing Then Return False
Return ItemId.Equals(other.ItemId) AndAlso Name.Equals(other.Name)
Console.WriteLine("Hello World")
Dim firstDupa = New Dupa() With {.ItemID = 1, .Name = "TEST1"}
Dim secondDupa = New Dupa() With {.ItemID = 2, .Name = "TEST2"}
Dim thirdDupa = New Dupa() With {.ItemID = 3, .Name = "TEST3"}
Dim firstList = New List(Of Dupa)({firstDupa, secondDupa})
Dim secondList = New List(Of Dupa)({firstDupa, thirdDupa})
Dim thirdList = New List(Of Dupa)({firstDupa, secondDupa})
Dim emptyList = New List(Of Dupa)
Dim nullList As List(Of Dupa) = Nothing
Console.WriteLine("First and Second: " & firstList.SequenceEqual(secondList))
Console.WriteLine("First and Third: " & firstList.SequenceEqual(thirdList))
Console.WriteLine("First and Empty: " & firstList.SequenceEqual(emptyList))
Console.WriteLine("First and Empty: " & firstList.SequenceEqual(nullList))