Translate GroupBy followed by FirstOrDefault (and similar) using ROW_NUMBER()
Open
area-groupby
area-query
customer-reported
- Dominant language
- C#
- Stars
- 14.8k
- Forks
- 3.4k
- PR merge metrics
- PR metrics pending
Description
### What problem are you trying to solve?
var result = await dbContext.YourTable
.GroupBy(e => e.GroupColumn)
.Select(g => g.OrderBy(e => e.SortColumn).FirstOrDefault())
.ToListAsync();
This way of writing will prompt an exception and cannot run
### Describe the solution you'd like
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.