Use LINQ AggregateBy()
ProprietaryReplace collection.GroupBy(keySelector).ToDictionary(g => g.Key, g => g.Aggregate(seed, func)) with collection.AggregateBy(keySelector, seed, func).ToDictionary(). Available since .NET 9.
OpenRewrite. Recipes. CSharp. Migration. Dotnet. Net9. UseLinqAggregateBymod run . --recipe= OpenRewrite. Recipes. CSharp. Migration. Dotnet. Net9. UseLinqAggregateByInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.