Let's assume I have an IQueryable
collection, and list of some strings.
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 ?