What does the interface IStructuralComparable do in C#?

CsharpProgrammingServer Side Programming

The IStructuralComparable interface supports the structural comparison of collection objects. This interface introduced in .NET 4.The following is the syntax −

public interface IStructuralComparable

It has a single method −

  • CompareTo(Object, IComparer) − It determines whether the current collection object precedes, occurs in the same position as, or follows another object in the sort order.

The compareTo() method determines whether the current collection object is less than, equal to, or greater than the second object in the sort order.

Explicit implementations for the IStructuralComparable Interface is provided by −

  • Generic tuple classes (Tuple<T1>, Tuple<T1,T2>, Tuple<T1,T2,T3>,…
  • Array class
raja
Published on 09-Aug-2018 11:08:54
Advertisements