Possible Duplicate:
Linq: “Or” equivalent of Where()
I posted a question about a week ago where the solution to append to a LINQ query based on if my parameters had values in them looked like:
var query = Database.Set<User>();
if (condition1.HasValue)
{
query = query.Where(x => x.Condition1 == condition1.Value);
}
if (condition2.HasValue)
{
query = query.Where(x => x.Condition2 == condition2.Value);
}
...
return query.ToList();
This code would append to the WHERE clause using AND. How would I go about appending to the WHERE clause using OR instead?