Ternary statements are strictly for assignments, not for else-if
or multi-decision logic. It would only work if both logic paths returned an instance of a type. :)
var result = booleanValue ? logicPathForTrue : logicPathForFalse;
A "good" (academic) use of ternary:
// Assign something to result. If something is null, assign new Something to result
Something result = something == null ? new Something() : something;
Ternary operations require variable assignment. This compiles:
var something = true ? new object() : null;
This does not compile:
true ? new object() : null;