title: SQL left outer join, groupby & orderby to LINQ method query or method syntax
body: <p>The main objective is to return a list of ingredients in a sorted order according to popularity (which is indicated by how many people have as their favorite a particular ingredient).  The SQL equivalent is below: </p>
  
  <pre><code>select distinct COUNT(PersonalInfoes.FavoriteIngredient_ID) as NoUsing, 
  Ingredients.Name 
  from PersonalInfoes  right join Ingredients
  on PersonalInfoes.FavoriteIngredient_ID = Ingredients.ID
  group by Ingredients.Name
  order by NoUsing desc
  </code></pre>
  
  <p>What is the equivalent SQL query of method syntax that will produce the same result as above?
  The closest I've got is this:</p>
  
  <pre><code>from i in db.Ingredients 
  join p in db.PersonalInfos on i.ID equals p.FavoriteIngredient.ID into ing
  from p in ing.DefaultIfEmpty()
  group i by i.Name into g
  from p in g
  orderby g.Count() descending
  select new { Name = g.Key, Count = g.Count() }.Name;
  </code></pre>