title: Multiple Row_number in LINQ
body: <p>I tried to translate </p>
  
  <pre><code>select * 
  from (
    select *, rng = row_number() over (partition by grp order by id)
    from (
      select *, grp = row_number() over (order by id) - row_number() over (partition by Name, Status, DateFinished order by id)
      from tooling ) g
    ) gn
  where rng = 1
  order by id
  </code></pre>
  
  <p>from an earlier question (<a href="https://stackoverflow.com/questions/37701539/grouping-with-partition-and-over-in-tsql">Grouping with partition and over in TSql</a>)</p>
  
  <p>With help with <a href="https://stackoverflow.com/questions/9980568/row-number-over-partition-by-xxx-in-linq">Row_number over (Partition by xxx) in Linq?</a>
  I got the solution to translate ONE of the row_number s but seems I'am out of luck to succesfully translate the entire question?<br>
  My attempt:</p>
  
  <pre><code>Tooling.OrderBy( x =&gt; x.Id)
      .GroupBy( x =&gt; new {x.Name,x.Status,x.DateFinished} )
      .Select( group =&gt; new { Group = group, Count = group.Count() } )
      .SelectMany( groupWithCount =&gt;
          groupWithCount.Group.Select( b =&gt; b)
          .Zip(
              Enumerable.Range( 1, groupWithCount.Count ),
              ( j, i ) =&gt; new { j.Name,j.Status, j.DateFinished, RowNumber = i }
          )
      )
  </code></pre>