IEqualityComparer Interface

July 28, 2014

Defines methods to support the comparison of objects for equality.

Namespace:  System.Collections
Assembly:  mscorlib (in mscorlib.dll)

public interface IEqualityComparer

The IEqualityComparer type exposes the following members.

  NameDescription
Public methodEqualsDetermines whether the specified objects are equal.
Public methodGetHashCodeReturns a hash code for the specified object.
Top

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

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

For the generic version of this interface, see System.Collections.Generic.IEqualityComparer<T>.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2014 Microsoft