mscorlib 4.0.0.0

Structural equality means that two objects are equal because they have equal values. It differs from reference equality, which indicates that two object references are equal because they reference the same physical object. The interface enables you to implement customized comparisons to check for the structural equality of collection objects. That is, you can create your own definition of structural equality and specify that this definition be used with a collection type that accepts the interface. The interface has two members: , which tests for equality by using a specified implementation, and , which returns identical hash codes for objects that are equal.

The interface supports only custom comparisons for structural equality. The interface supports custom structural comparisons for sorting and ordering.

The .NET Framework also provides default equality comparers, which are returned by the and properties. For more information, see the example.

The generic tuple classes (, , , and so on) and the class provide explicit implementations of the interface. By casting (in C#) or converting (in Visual Basic) the current instance of an array or tuple to an interface value and providing your implementation as an argument to the method, you can define a custom equality comparison for the array or collection.

Defines methods to support the comparison of objects for structural equality.

- Method
  4.0.0.0
  System.Boolean `` ``

  The method supports custom structural comparison of array and tuple objects. This method in turn calls the object's method to compare individual array elements or tuple components, starting with the first element or component. The individual calls to end and the method returns a value either when a method call returns false or after all array elements or tuple components have been compared.

  Determines whether an object is structurally equal to the current instance.

  true if the two objects are equal; otherwise, false.

  The object to compare with the current instance. An object that determines whether the current instance and are equal.
- Method
  4.0.0.0
  System.Int32 ``

  Implement this method to return customized hash codes for collection objects that correspond to the customized comparison for structural equality provided by the method.

  Returns a hash code for the current instance.

  The hash code for the current instance.

  An object that computes the hash code of the current object.