Permalink
Fetching contributors…
Cannot retrieve contributors at this time
43 lines (33 sloc) 1005 Bytes

RCS1015: Use nameof operator

Property Value
Id RCS1015
Category Maintainability
Default Severity Info
Enabled by Default
Supports Fade-Out -
Supports Fade-Out Analyzer

Example

Code with Diagnostic

public void Foo(object parameter)
{
    if (parameter == null)
    {
        throw new ArgumentNullException("parameter", "message"); // RCS1015
    }
}

Code with Fix

public void Foo(object parameter)
{
    if (parameter == null)
    {
        throw new ArgumentNullException(nameof(parameter), "message");
    }
}

See Also

(Generated with DotMarkdown)