I was wondering if it would be possible to do an other wise type statement within lambda, something similar to:
Have two table structures that looks exactly the same, except for one column, called Synopsis (table 1) and Description (table 2). My component reads either one of the two tables, based on a property, and would like to do a single lambda expression to determine whether the column exists:
(from p in table[this.TableName]
where (p["Description"] != null)
'otherwise' where (p["Synopsis"] != null)
select p).First();
Appreciate the help.
Providing that accessing a non-existent column doesn’t thrown an exception, you should be able to use the logical OR operator (
||):