mscorlib 2.0.0.0 4.0.0.0 Contravariant To be added.

This interface allows the implementation of customized equality comparison for collections. That is, you can create your own definition of equality for type , and specify that this definition be used with a collection type that accepts the generic interface. In the .NET Framework, constructors of the generic collection type accept this interface.

A default implementation of this interface is provided by the property of the generic class. The class implements of type .

This interface supports only equality comparisons. Customization of comparisons for sorting and ordering is provided by the generic interface.

We recommend that you derive from the class instead of implementing the interface, because the class tests for equality using the method instead of the method. This is consistent with the Contains, IndexOf, LastIndexOf, and Remove methods of the class and other generic collections.

Defines methods to support the comparison of objects for equality.

- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` `` First to compare. Second to compare.

  Determines whether the specified objects are equal.

  if the specified objects are equal; otherwise, .

  An implementation of Equals(T,T) shall satisfy the following: The equality function shall be be reflexive, so x.Equals(x) is true; symmetric, so x.Equals(y) and y.Equals(x); and transitive, so x.Equals(y) and y.Equals(z) implies x.Equals(z); for any values x, y and z for which these expressions are defined.

- Method
  2.0.0.0
  4.0.0.0
  System.Int32 `` The object for which the hash code is to be returned.

  Returns a hash code for the specified object.

  A hash code for the specified object.

  To produce a hash function for the given object. A hash function is used to quickly generate a number (a hash code) corresponding to the value of an object. Hash functions are used with . A good hash function algorithm rarely generates hash codes that collide. For more information about hash functions, see , Vol. 3, by Donald E. Knuth.

  All implementations are required to ensure that if x.Equals(y) == true, then x.GetHashCode() equals y.GetHashCode(), for any x and y values for which these expressions are defined.

  The type of is a reference type and is .