on further thought, the second example would translate more like this if you were to use sql server EF6:

<pre>
select [all columns except rownum]
from ( select *,
              row_number() over (partition by col1 order by col2) rownum
       from table ) x
where x.rownum = 1
</pre>