Support .NET 9.0 CountBy
Open
area-query
- Dominant language
- C#
- Stars
- 14.8k
- Forks
- 3.4k
- PR merge metrics
- PR metrics pending
Description
[Release notes](https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-9/overview#linq)
[Docs](https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.countby?view=net-9.0)
```c#
KeyValuePair mostFrequentWord = sourceText
.Split(new char[] { ' ', '.', ',' }, StringSplitOptions.RemoveEmptyEntries)
.Select(word => word.ToLowerInvariant())
.CountBy(word => word)
.MaxBy(pair => pair.Value);
```
Contributor guide
Assessment
This issue has not been assessed yet.