Extension method for IComparable
C# 3.0 gives great feature of extension method. I am also very much interested for Extension method. Today, My friend Divyang posts very useful topic "Extension Meathod for IComparable". I would like to share you something interesting way to use
that extension method. This time it's extending IComparable. The API signature for IComparable<T>
has been around since the birth of C language . If the left is less
than the right, return something less than 0, if left is greater than
right, return something greater than 0, and if they are equivalent,
return 0. Well, its readability leaves a bit to be desired.
So Here we have set of extension methods for any type T that implements IComparable: