Use LINQ CountBy()
ProprietaryReplace collection.GroupBy(selector).Select(g => g.Count()) with collection.CountBy(selector). Available since .NET 9.
OpenRewrite. Recipes. CSharp. Migration. Dotnet. Net9. UseLinqCountBymod run . --recipe= OpenRewrite. Recipes. CSharp. Migration. Dotnet. Net9. UseLinqCountByInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.