I have dynamic string generated from back end which generates expression like:
"Col NOT IN ('ABC','CDE','EDF'...)"
I would like to make use of above string has predicate to my IEnumerable collection. Does Dynamic LINQ supports NOT IN operation?
I have dynamic string generated from back end which generates expression like:
"Col NOT IN ('ABC','CDE','EDF'...)"
I would like to make use of above string has predicate to my IEnumerable collection. Does Dynamic LINQ supports NOT IN operation?
It is possible to do this by using a SQL syntax that is much less common, but does the same thing:
"NOT (Col IN ('ABC','CDE','EDF'...))"
This works both for SQL and Dynamic Linq
You didn't provide your sample code but it seems something like;
var array = new [] {"ABD", "ABC", "BED"};
var result = _context.table.Where(x => !array.Any(y => x.Col1 == y));