With PredicateBuilder, how do I get functionality similar to SQL IN or NOT IN?
For example, I have a list of identifiers, and I want to select all people whose identifiers match or do not match identifiers.
The people matching function is pretty simple (although there may be a better way to do this)
var predicate = PredicateBuilder.False<Person>() foreach (int i in personIDs) { int temp = i; predicate = predicate.Or(e=>e.PersonID == temp); } return persons.Where(predicate);
So how do I get the opposite? I want all individuals whose identifiers are not on the personID list.
source share