We have two types of "comparers" in C#: the IComparer (IComparer<T>) interface and Comparison<T>.
In deep past, before generics were introduced, the base class library used IComparer everywhere. For example, the ArrayList class can sort items using custom IComparer passed as a parameter to the Sort() method.
When generics were introduced, the base class library in many cases allows either an IComparer or Comparison to be passed to sorting methods. For example, the List<T>'s Sort method accepts either the former or the latter.
It's fairly easy to convert from IComparer to Comparison<T>. Take a look at this example:
However, what should we do to convert the other way around?
Specifically, take a look at this code snippet