title: Entity Framework with Linq, inner Join, Group By, Order By
body: <p>I have a SQL Query</p>
  
  <pre><code>select Firma.Name as companyName, 
         Taetigkeit.Taetigkeit as skillName, 
         SUM(Zeit) as time
  from Zeiterfassung 
  inner join Firma On ZEiterfassung.FirmenID = Firma.ID    
  inner join Taetigkeit on Zeiterfassung.TaetigkeitID = Taetigkeit.ID    
  group by Taetigkeit, Firma.Name    
  order by Firma.Name 
  </code></pre>
  
  <p>And want to "translate" it to linq. Here is what I tried:</p>
  
  <pre><code>var query = db.Zeiterfassung
                .Where(x =&gt; x.Firma.ID == x.FirmenID &amp;&amp; x.TaetigkeitID == x.Taetigkeit.ID)
                .GroupBy(x =&gt; x.Taetigkeit.Taetigkeit1)
                .Select(x =&gt; new Evaluation() { skillName = x.Key, time = x.Sum(y =&gt; y.Zeit), //skillName = x.Sum(x =&gt; x.Zeit), })
                .OrderBy(x =&gt; x.skillName);
  </code></pre>
  
  <p>I dont know who to solve this with joins and the group by because all the time when i do a groupBy i cant access the other members.</p>