Duplicate:
http://stackoverflow.com/questions/782339/how-to-dynamically-add-or-operator-to-where-clause-in-linq
I want to loop through a array of string values and build a linq expression
Where each item in the list is OR'ed together.
string[] search = new string[]{"A", "B", "C"};
foreach (string item in filterValues)
{
searchQuery = searchQuery.Where(s => s.Name.Contains(item));
}
The code above searched for "A" AND "B" AND "C"
I want to search for "A" OR "B" OR "C".
I know how to do this with Linq but I want to accomplish the same thing using extension methods.