Ahh, don\'t you just love a good ternary abuse? :) Consider the following expression:
true ? true : true ? false : false
For those of you w
Yes, you can rely on this (not only in C# but in all (that I know) other languages (except PHP … go figure) with a conditional operator) and your use-case is actually a pretty common practice although some people abhor it.
The relevant section in ECMA-334 (the C# standard) is 14.13 §3:
The conditional operator is right-associative, meaning that operations are grouped from right to left. [Example: An expression of the form
a ? b : c ? d : eis evaluated asa ? b : (c ? d : e). end example]