Making a Where class append with "OR"

Posts   
 
    
worldspawn avatar
worldspawn
User
Posts: 321
Joined: 26-Aug-2006
# Posted on: 03-Aug-2009 03:50:00   

Hello,

is there some way to make a clause added to an IQueryable with "Where" extension method append to any preexisiting clauses using "OR" instead of "AND"?

iquery.Where(p=>p.Sky=="Blue");

iquery.Where(p=>p.Sky=="Orange");

this will generate WHERE SKY = "BLUE" AND SKY="Orange" but I want it to be WHERE SKY="BLUE" OR SKY="ORANGE". Possible?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39861
Joined: 17-Aug-2003
# Posted on: 03-Aug-2009 17:40:52   

I think this can be done with the predicate builder: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=14224

Frans Bouma | Lead developer LLBLGen Pro