Sort one list by another

Another LINQ-approach:

 var orderedByIDList = from i in ids 
                       join o in objectsWithIDs
                       on i equals o.ID
                       select o;

Leave a Comment