How do I utilize a ?: operator in the SELECT clause of a LINQ query? If this can\'t be done, how can I emulate one? The goal is to get a CASE block in my select claus
if you're checking just for null, you can also use ??
string something = null;
string somethingElse = something ?? "default value";
As for the examples above, it is correct to do the ones that go...
string something = (somethingElse == null ? "If it is true" : "if it is false");
The parens aren't required, but they do aid in reading.