System.IEquatable<T>

Defines a generalized method that a value type or class implements to create a type-specific method for determining equality of instances.

See Also: IEquatable<T> Members

Syntax

public interface IEquatable<T>

Type Parameters

T
Documentation for this section has not yet been entered.

Remarks

This interface is implemented by types whose values can be equated (for example, the numeric and string classes). A value type or class implements the IEquatable`1.Equals(`0) method to create a type-specific method suitable for determining equality of instances.

Note:

The IComparable`1 interface defines the IComparable`1.CompareTo(`0) method, which determines the sort order of instances of the implementing type. The IEquatable`1 interface defines the IEquatable`1.Equals(`0) method, which determines the equality of instances of the implementing type.

The IEquatable`1 interface is used by generic collection objects such as Dictionary`2, List`1, and LinkedList`1 when testing for equality in such methods as Contains, IndexOf, LastIndexOf, and Remove. It should be implemented for any object that might be stored in a generic collection.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0