Use Guid.CreateVersion7()
ProprietaryReplace Guid.NewGuid() with Guid.CreateVersion7(). Version 7 GUIDs are time-ordered and better for database primary keys, indexing, and sorting. Available since .NET 9.
OpenRewrite. Recipes. CSharp. Migration. Dotnet. Net9. UseGuidCreateVersion7mod run . --recipe= OpenRewrite. Recipes. CSharp. Migration. Dotnet. Net9. UseGuidCreateVersion7Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.