title: How to Sort a List<T> by a another list in the object
body: <p>Please note to the following topic that has already been raised :</p>
  
  <blockquote>
    <p><a href="https://stackoverflow.com/questions/3309188/how-to-sort-a-listt-by-a-property-in-the-object">How to Sort a List by a property in the
    object</a></p>
  </blockquote>
  
  <p>I want to sort a list by another list. I add to the list with the following command :</p>
  
  <pre><code>ListClass.Add(new item_util(items[b], util[b]));
  </code></pre>
  
  <p>Now based on the above topic , I can sort items by ascending :</p>
  
  <pre><code>List&lt;item_util&gt; SortedList = ListClass.OrderBy(o=&gt;o.items).ToList();
  </code></pre>
  
  <p>I do not want to sort ascending. How can I sort items by another list (ListA)?</p>
  
  <p><strong>Updated</strong></p>
  
  <pre><code>int[] items = {7, 4, 1};
  int[] util  = {5, 11, 20};
  var listA   = new List&lt;int&gt; {5, 4, 1, 2, 7, 3, 8, 6};
  
  List&lt;item_util&gt; ListClass= new List&lt;item_util&gt;();
  for (int b = 0; b &lt; items.Length; b++)
      ListClass.Add(new item_util(items[b], util[b]));
  List&lt;item_util&gt; SortedList = ListClass.OrderBy(o =&gt; o.item).ToList();
  </code></pre>
  
  <p>Currently <code>SortedList</code> output is equal to: <code>{(1,20),(4,11),(7,5)}</code></p>
  
  <p>But I want to sort the list acording to listA. So the output must be obtained as : <code>{(4, 11), (1, 20), (7, 5)}</code></p>
  
  <p>Because they are arranged in ListA as : {5, <strong>4</strong>, <strong>1</strong>, 2, <strong>7</strong>, 3, 8, 6}</p>