Skip to content

Latest commit

 

History

History
51 lines (37 loc) · 1.16 KB

RCS1048.md

File metadata and controls

51 lines (37 loc) · 1.16 KB

RCS1048: Use lambda expression instead of anonymous method

Property Value
Id RCS1048
Category Usage
Default Severity Info
Enabled by Default
Supports Fade-Out -
Supports Fade-Out Analyzer

Example

Code with Diagnostic

var x = items.Select(delegate (object f) // RCS1048
{
    return f.ToString();
});

Code with Fix

var x = items.Select((object f) =>
{
    return f.ToString();
});

How to Suppress

SuppressMessageAttribute

[assembly: SuppressMessage("Usage", "RCS1048:Use lambda expression instead of anonymous method.", Justification = "<Pending>")]

#pragma

#pragma warning disable RCS1048 // Use lambda expression instead of anonymous method.
#pragma warning restore RCS1048 // Use lambda expression instead of anonymous method.

Ruleset

(Generated with DotMarkdown)