All rules
IDE0350Language rules (expression-level preferences)
Use implicitly typed lambda
Use implicitly typed lambda
Microsoft docsDescription
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:
trueYour vote
Group results
0 yes 0 no
ConsensusNone (disabled)
Severity preference (yes voters)
Suggestion0
Warning0
Error0