title: complex orderby that links to another table
body: <p>I have the following query to start with:</p>
  
  <pre><code>var query = from p in db.Products
                          from pc in p.NpProductCategories
                          where pc.CategoryId == categoryId 
                          select p;
  </code></pre>
  
  <p>I'm applying some more filtering on it and in the end I want to sort the results:</p>
  
  <pre><code>if (orderBy == ProductSortingEnum.Name)
                      query = query.OrderBy(x =&gt; x.Name);
                  else
                      query = query.OrderBy(............);
  </code></pre>
  
  <p>My big problem (coming from not knowing linq too good) is the ELSE here. How can I sort results by a column that is not in the current result set? I would like to somehow link to another linq query in the orderby. <strong>The sorting I'm trying to achive is to link to NpProductVariants query using the ProductId to match between NpProductVariant and Products
   and sort by the Price of the NpProductVariant</strong></p>