Skip to main content
Source: AL0014PreferPatternMatchingAnalyzer.cs

Description

Pattern matching syntax (is/is not) is more expressive and idiomatic. For null checks, it also bypasses overloaded equality operators.

Bad Code

Good Code

Properties

  • Category: Style
  • Severity: Warning
  • Enabled by default: True
  • Code fix available: True

Configuration