Imports DigitalData.Modules.Interfaces

Public Class UserEqualityComparer
    Implements IEqualityComparer(Of ADUser)

    Public Overloads Function Equals(x As ADUser, y As ADUser) As Boolean Implements IEqualityComparer(Of ADUser).Equals
        If ReferenceEquals(x, y) Then Return True
        If x Is Nothing Or y Is Nothing Then Return False

        Return x.SId = y.SId
    End Function

    Public Overloads Function GetHashCode(obj As ADUser) As Integer Implements IEqualityComparer(Of ADUser).GetHashCode
        If obj Is Nothing Then Return 0

        Dim oHashCode = obj.SId.GetHashCode()
        Return oHashCode
    End Function
End Class
