Expression-level preferences
.NET expression-level preferences
The style rules in this section concern the following expression-level preferences that are common to C# and Visual Basic:
- Add missing cases to switch statement (IDE0010)
- Use object initializers (IDE0017)
- Use collection initializers (IDE0028)
- Use auto property (IDE0032)
- Use explicitly provided tuple name (IDE0033)
- Use inferred member name (IDE0037)
- Use conditional expression for assignment (IDE0045)
- Use conditional expression for return (IDE0046)
- Convert anonymous type to tuple (IDE0050)
- Use compound assignment (IDE0054 and IDE0074)
- Use 'System.HashCode.Combine' (IDE0070)
- Simplify interpolation (IDE0071)
- Simplify conditional expression (IDE0075)
- Convert 'typeof' to 'nameof' (IDE0082)
C# expression-level preferences
The style rules in this section concern the following expression-level preferences that are specific to C#:
- Inline variable declaration (IDE0018)
- Simplify 'default' expression (IDE0034)
- Use local function instead of lambda (IDE0039)
- Deconstruct variable declaration (IDE0042)
- Use index operator (IDE0056)
- Use range operator (IDE0057)
- Add missing cases to switch expression (IDE0072)
- Simplify 'new' expression (IDE0090)
- Use tuple to swap values (IDE0180)
See also
Feedback
Submit and view feedback for