csharp inline if
Code Example - csharp inline if
(condition ? [true value] : [false value])
int x = a ? b : c;
csharp if statement one line
someValue = condition ? newValue : someValue;
csharp ternary operator
is this condition true ? yes : no
one line condition csharp
((a != null) ? (Action)(() => { b = a; }) : () => { /*Do something else*/ })();
ternary operator in csharp
ternary
ternary operator csharp
conditional-expression:
conditional-or-expression
conditional-or-expression ? expression : expression
simplified if statement csharp
bool c1=true, c2=true;
if(!(!c1 || c2)){
}