All rules
IDE0083Language rules (pattern matching preferences)

Use pattern matching (not operator)

Use pattern matching (not operator)

Microsoft docs

Description

This style rule concerns the use of C# 9.0 not pattern, when possible.

Example

// csharp_style_prefer_not_pattern = true
var y = o is not C c;

// csharp_style_prefer_not_pattern = false
var y = !(o is C c);

Configurable options

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

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