Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate LINQ CountBy #32741

Open
Tracked by #25570
manandre opened this issue Jan 7, 2024 · 1 comment
Open
Tracked by #25570

Translate LINQ CountBy #32741

manandre opened this issue Jan 7, 2024 · 1 comment

Comments

@manandre
Copy link

manandre commented Jan 7, 2024

.NET 9.0 will introduce CountBy, which we could translate.

CountBy can be rewritten as follows:

_ = 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 #25570

@roji
Copy link
Member

roji commented Jan 7, 2024

Thanks @manandre, makes sense! Added to the epic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants