Use ArgumentOutOfRangeException.ThrowIfLessThan()
ProprietaryReplace if (value < other) throw new ArgumentOutOfRangeException(nameof(value)) guard clauses with ArgumentOutOfRangeException.ThrowIfLessThan(value, other). Also handles reversed other > value and <=/ThrowIfLessThanOrEqual. Available since .NET 8.
OpenRewrite. Recipes. CSharp. Migration. Dotnet. Net8. UseThrowIfLessThanmod run . --recipe= OpenRewrite. Recipes. CSharp. Migration. Dotnet. Net8. UseThrowIfLessThanInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.