title: Ordering my LINQ
body: <p>I have this list of companies (joined to categories), in which i search by free text input and normally order the results by name / alphabetically.</p>
  
  <p>But, when the returned companies are linked to a certain category (the id's of these more important categories are in a List), i want to primarily order the results with the companies from those categories on top and secondary ordering should be alphabetically.  </p>
  
  <p>How can i add this ordering? </p>
  
  <pre><code>    List&lt;int&gt; importantCategories = new List&lt;int&gt;() { 14, 99, 4428 };
  
      var companies = (from c in context.Companies
                       join ct in context.Categories on c.CategoryId equals ct.CategoryId
                       where ct.Active == true 
                       &amp;&amp; c.Name.Contains(freeTextFilter)
                       orderby c.Name
                         --- if company is from category 14, 99, 4428 
                             then the ordering should place those above the rest
                       select c);
  </code></pre>
  
  <p>I took out a couple of lines from the query, but added one of those after the questions why i was not using the joined Categories table. </p>