Skip to content

Latest commit

 

History

History
41 lines (31 loc) · 887 Bytes

RCS1015.md

File metadata and controls

41 lines (31 loc) · 887 Bytes

RCS1015: Use nameof operator

Property Value
Id RCS1015
Category Maintainability
Severity Info
Minimal Language Version 6.0

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)