sort list of objects by list of longs
<p>I have a class model somewhat like this:</p>

<pre><code>public class MyModel
{
   long MyModelID { get; set; }
}
</code></pre>

<p>I have a list of <code>MyModel</code> objects called <code>TheListOfModels</code> and a list of longs called <code>TheListOfIDs</code>: I want <code>TheListOfModels</code> to be sorted in the same order as <code>TheListOfIDs</code>.</p>

<p>What I have in mind is a loop that goes through the <code>TheListOfIDs</code> and at each iteration adds the corresponding <code>TheListOfModels</code> to a new list called <code>SortedList</code> and then reassigns that list to the original <code>TheListOfModels</code>.</p>

<p>Is this the best way to do it or is there a linq syntax for this specific operation?</p>

<p>Thanks. </p>
