title: Sorting List with Custom object by another List using IComparer
body: <p>My question is about the <code>IComparer</code> interface, I never worked with it before, so I hope you can help me set up everything right.</p>
  
  <p>I have to use the interface to sort an list of own objects by the exact sequence of another <code>List&lt;int&gt;</code>. 
  I couldn't find anything usefull with that problem on the net, everything I found were linq statements, that I can not use.</p>
  
  <p>Here is the example code:</p>
  
  <pre><code>public class What : IComparer&lt;What&gt;
  {
      public int ID { get; set; }
      public string Ever { get; set; }
  
      public What(int x_ID, string x_Ever)
      {
          ID = x_ID;
          Ever = x_Ever;
      }
  
      public int Compare(What x, What y)
      {
          return x.ID.CompareTo(y.ID);
      }
  }
  </code></pre>
  
  <p>Some data to work with:</p>
  
  <pre><code>List&lt;What&gt; WhatList = new List&lt;What&gt;()
  {
      new What(4, "there"),
      new What(7, "are"), 
      new What(2, "doing"),
      new What(12, "you"),
      new What(78, "Hey"),
      new What(63, "?")
  };
  </code></pre>
  
  <p>And the list with the correct order:</p>
  
  <pre><code>List&lt;int&gt; OrderByList = new List&lt;int&gt;() { 78, 4, 63, 7, 12, 2 };
  </code></pre>
  
  <p>So now how can I tell <code>IComparer</code> to sort by the <code>OrderByList</code>? 
  I really got no clue how to do that, I know this would be pretty easy with linq, but I don't have the opportunity to use it.</p>