All rules
IDE0350Language rules (expression-level preferences)

Use implicitly typed lambda

Use implicitly typed lambda

Microsoft docs

Description

This rule flags places where an explicitly typed lambda expression can be converted to an implicitly typed lambda expression.

Example

// Code with violations.
Action<int> a = (int x) => { };
Delegate b = (Action<int>)( (int x) => { } );

// Fixed code.
Action<int> a = x => { };
Delegate b = (Action<int>)( x => { } );

Configurable options

Vote for the value each option should take in the generated .editorconfig.

csharp_style_prefer_implicitly_typed_lambda_expression
default: true
Group results
0 yes 0 no
ConsensusNone (disabled)
Severity preference (yes voters)
Suggestion0
Warning0
Error0