title: 'orderby' in linq using a string array c#
body: <p>Say I have a method definition as such:</p>
  
  <pre><code>public CustomerOrderData[] GetCustomerOrderData(string[] CustomerIDs)
  {
   var query = (from a in db.Customer
                join b in db.Order on a.CustomerID equals v.CustomerID
                orderby CustomerIDs
                select new CustomerOrderData()
                {
                  //populate props here
                }).ToArray();
  }
  </code></pre>
  
  <p>My CustomerIDs in input param could be {"1","3","400","200"}</p>
  
  <p>I want my return array to be ordered in the above fashion. Is there an easy way to achive this?</p>
  
  <p>My solution was to put it into a Dictionary and then create a new array while looping through my CustomerIDs collection.</p>
  
  <p>CustomerOrderData does have a property named CustomerID</p>