Translate LINQ CountBy
Open
area-query
customer-reported
- Dominant language
- C#
- Stars
- 14.8k
- Forks
- 3.4k
- PR merge metrics
- PR metrics pending
Description
.NET 9.0 will introduce [CountBy](https://github.com/dotnet/runtime/issues/77716), which we could translate.
CountBy can be rewritten as follows:
```cs
_ = blogs.CountBy(b => b.Id);
_ = blogs.GroupBy(b => b.Id).Select(g => KeyValuePair.Create(g.Key, g => g.Count()));
```
This feature could be part of the epic https://github.com/dotnet/efcore/issues/25570
Contributor guide
Assessment
This issue has not been assessed yet.