We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
With .NET 6, this code
if (foo is null) throw new ArgumentNullException(nameof(foo));
can be replaced by
ArgumentNullException.ThrowIfNull(foo, nameof(foo));
which is to be prefered.
The text was updated successfully, but these errors were encountered:
Wasn't it possible before to Property = argument ?? throw new ArgumentNullException(nameof(argument));?
Property = argument ?? throw new ArgumentNullException(nameof(argument));
Sorry, something went wrong.
Yes it was, but when simply null-checking method arguments, you would have to do something like
_ = arg ?? throw new ArgumentNullException(nameof(arg));
I guess that pattern stays constructor-exclusive for now.
Seb-stian
Successfully merging a pull request may close this issue.
With .NET 6, this code
can be replaced by
which is to be prefered.
The text was updated successfully, but these errors were encountered: