Exists() can take a SimpleExpression argument to add a filter to its query. However, when the argument is a malformed SimpleExpression, Exists seems to ignore it and run as if it had no argument at all. For example,
var testOne = db.Albums.Exists(db.Albums.GenreId); // Just column name
var testTwo = db.Albums.Exists(1); // No column names
var testThree = db.Albums.Exists(true); // No column names
In all three cases, I would expect a BadExpressionException to be thrown. Instead, SimpleData checks for data in the Albums data and returns true.
Exists() can take a SimpleExpression argument to add a filter to its query. However, when the argument is a malformed SimpleExpression, Exists seems to ignore it and run as if it had no argument at all. For example,
In all three cases, I would expect a
BadExpressionException
to be thrown. Instead, SimpleData checks for data in the Albums data and returns true.