RCS1015: Use nameof operator
Properties
Property | Value |
---|---|
Default Severity | Info |
Minimum language version | 6.0 |
Examples
Example #1
diagnostic.cs
public void Foo(object parameter)
{
if (parameter == null)
{
throw new ArgumentNullException("parameter", "message");
}
}
fix.cs
public void Foo(object parameter)
{
if (parameter == null)
{
throw new ArgumentNullException(nameof(parameter), "message");
}
}