IEqualityComparer<T>.GetHashCode(T) IEqualityComparer<T>.GetHashCode(T) Method


Returns a hash code for the specified object.

public int GetHashCode (T obj);
Public Function GetHashCode (obj As T) As Integer

The Object for which a hash code is to be returned.


A hash code for the specified object.


The type of obj is a reference type and obj is null.


Implement this method to provide a customized hash code for type T,corresponding to the customized equality comparison provided by the Equals method.

Notes to Implementers

Implementations are required to ensure that if the Equals(T, T) method returns true for two objects x and y, then the value returned by the GetHashCode(T) method for x must equal the value returned for y.

Applies to

See Also