title: System.Comparison<T> understanding
body: <p><code>List&lt;T&gt;.Sort()</code> method has 3 overloads.</p>
  
  <p>One of them is the following</p>
  
  <pre><code>System.Collections.Generic.List&lt;T&gt;.Sort(System.Comparison&lt;T&gt;)
  </code></pre>
  
  <p>On seeing <code>Comparison&lt;T&gt;</code>, I thought that it should be a class which is derived from <code>Comparison&lt;T&gt;</code> class. (An usual interpretation on the parameters)</p>
  
  <p>But the following works really well and said to be using the above overload.</p>
  
  <pre><code>        public static void Main(string[] args)
          {
              List&lt;Int32&gt; collection = new List&lt;Int32&gt;();
  
              collection.Add(20);
              collection.Add(270);
              collection.Add(30);
              collection.Add(90);
              collection.Add(40);
              collection.Add(18);
              collection.Add(100);
  
              collection.Sort(MyComparer.CompareWithCase);
  
              foreach (Int32 s in collection)
                  Console.WriteLine(s);
          }
  
          public static int CompareWithCase(int i1, int i2)
          {
              return i1.ToString().CompareTo(i2.ToString());
          }
  </code></pre>
  
  <p>I did give a delegate to a static Method in place of <code>Comparison&lt;T&gt;</code>.
  How does it work?</p>