Lets assume, I have a IQuerable collection, and list of somestrings.
I can build query this way:
foreach (var somestring in somestrings)
{
collection = collection.Where(col=>col.Property.Contains(somestring);
}
Which will produce following SQL query:
SELECT ...... FROM ..... WHERE
(Property LIKE '%something1%') AND
(Property LIKE '%something2%') AND
(Property LIKE '%something3%')
Note, that WHERE clauses are connected with ANDs.
Is there way, to construct similar query, but connected with ORs ?