title: Sorting an List<> with my custom order which is stored in another List (C#)?
body: <p>Can anyone help.. I have a generic list like so</p>
  
  <pre><code>    IList&lt;itemTp&gt; itemTps;
  </code></pre>
  
  <p>itemTp basically is a class (has a number of properties) and one property on this is "code"</p>
  
  <p>I need to be able to sort it an specific order which i have set in another List.</p>
  
  <p>This list is a simple list that lists the order (starting from first to last) like say</p>
  
  <p>code1
  code3
  code2
  code5
  (notice it goes from 1 to 3 to 2 to 5 - these are the names, they can be called anything .. the important thing is the order, it doesn't have anything to do with the numbers)</p>
  
  <p>Basically i need ensure the items in itemTp sort according what is present in the other list...</p>
  
  <p>So imagine my Ilist is like this code1,code2,code3,code5 - so once the sort is done
  in my               </p>
  
  <pre><code>       IList&lt;itemTp&gt;
  </code></pre>
  
  <p>will contain 4 classes that are in order and have the property like code1,code3,code2,code5  (order change)</p>
  
  <p>Any ideas how to do this?</p>