dotnet / dotnet/dotnet-api-docs
Add example to ArgumentNullException.ThrowIfNull
- Dominant language
- C#
- Stars
- 949
- Forks
- 1.7k
- Avg merge
- 3d 27m
- Merged PRs (30d)
- 49
Description
[ArgumentNullException.ThrowIfNull()](https://docs.microsoft.com/en-us/dotnet/api/system.argumentnullexception.throwifnull?view=net-6.0) should contain an example. It looks like this is currently the only public method that uses the `CallerArgumentExpressionAttribute` so the usage might not be clear to everyone yet.
This would be especially helpful until the documentation actually shows the `CallerArgumentExpressionAttribute` (see https://github.com/dotnet/dotnet-api-docs/issues/7080#issuecomment-1004343388).
The example could even hint at the "global static using" feature like shown here: https://github.com/dotnet/csharplang/issues/2145#issuecomment-910081172
Contributor guide
Assessment
This issue has not been assessed yet.