GroupBy nullable column followed by First() over group returns null record
- Dominant language
- C#
- Stars
- 14.8k
- Forks
- 3.4k
- PR merge metrics
- PR metrics pending
Description
```
var query = applicationDbContext.Categories
.GroupBy(x => x.GroupId)
.Select(x => x.OrderByDescending(x => x.CreationDateTime).First());
```
Result:

Expected result:

Workaround:
```
var query = applicationDbContext.Categories
.GroupBy(x => x.GroupId ?? 0)
.Select(x => x.OrderByDescending(x => x.CreationDateTime).First());
```
Reproduction repo:
https://github.com/alienwareone/EfCoreGroupByNullable
Contributor guide
Assessment
This issue has not been assessed yet.