Snippet: conditional operator (not equal to null)

property value
IDE Visual Studio
Language C#
Title conditional operator (not equal to null)
Shortcut coxn
Description conditional operator with condition whether the expression is not equal to null
Snippet Types Expansion

Placeholders

Identifier Tooltip Default Value Editable Function Type Name
expression Expression to evaluate expression yes
false False expression false yes
true True expression true yes

Code

(expression != null) ? true : false