Editorconfig Guide.e

Condition delegate call

EditorConfig key: csharp-style-condition-delegate-call

Condition delegate call

csharp-style-condition-delegate-call

This option controls whether the null-conditional operator should be preferred over an explicit null check when invoking a delegate.

Default value:

true

Possible values:

  • true
  • false

Examples

true
condition?.Invoke();
false
if (condition != null)
  condition();