Editorconfig Guide.e

Coalesce expression

EditorConfig key: dotnet-style-coalesce-expression

Coalesce expression

dotnet-style-coalesce-expression

This option controls whether the null-coalescing operator should be preferred over explicit null-check ternary expressions.

Default value:

true

Possible values:

  • true
  • false

Examples

true
var value = obj ?? other;
false
var value = obj != null ? obj : other;