Use LINQ Order() and OrderDescending()

Proprietary

Replace collection.OrderBy(x => x) with collection.Order() and collection.OrderByDescending(x => x) with collection.OrderDescending(). Available since .NET 7.

OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net7.UseLinqOrder
mod run . --recipe=OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net7.UseLinqOrder

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.