I have a problem using the dynamic expression API. I cannot compare the DataTable field with DBNull.Value. It is assumed that the API will be able to "support access to a static field or static property." Access to any open field or property. "However, given the following request:
var whatever = table1.AsEnumerable()
.Join(table2.AsEnumerable(),
(x) => x.Field<int>("Table1_ID"),
(y) => y.Field<int>("Table2_ID"),
(x, y) => new { x, y})
.AsQueryable()
.Where("x[\"NullableIntColumnName\"] == DBNull.Value");
I get the error: "No property or field" DBNull "exists in type" <> f__AnonymousType0`2 ""
Anyone have any ideas on how to get around this? I cannot use Submission.Field ("NullableIntColumnName") in the string passed to the Where method, either btw, or else I could compare with null instead of DBNull.Value.
source
share