Use ArgumentException.ThrowIfNullOrEmpty()
ProprietaryReplace if (string.IsNullOrEmpty(s)) throw new ArgumentException("...", nameof(s)) guard clauses with ArgumentException.ThrowIfNullOrEmpty(s). Available since .NET 7.
OpenRewrite. Recipes. CSharp. Migration. Dotnet. Net7. UseThrowIfNullOrEmptymod run . --recipe= OpenRewrite. Recipes. CSharp. Migration. Dotnet. Net7. UseThrowIfNullOrEmptyInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.