title: Results from LINQ with SUM for TimeSpan, GROUP and JOIN
body: <p>I've following EF model:</p>
  
  <p><img src="https://i.stack.imgur.com/hcsFf.png" alt="enter image description here"></p>
  
  <p>I want to get data in following view:</p>
  
  <p><img src="https://i.stack.imgur.com/I0rzY.png" alt="enter image description here"></p>
  
  <p>In Data entity Time is Timespan with milliseconds. In result, <code>PlaceInStep</code> is place between members by <code>StepId</code>.</p>
  
  <p>How to make this hard query? </p>
  
  <p><strong>Edit 1</strong>:</p>
  
  <p>My some code:</p>
  
  <pre><code>var query = from data in ctx.Data
                              join member in ctx.Members
                              on data.MemberId equals member.MemberId
                              join team in ctx.Teams
                              on member.TeamId equals team.TeamId
                              group member by member.TeamId into g
                              select new {TeamId = g.Key, TeamName = g.Select(t=&gt;t.Teams.TeamName), TotalTime = ???};
  </code></pre>