Linq multplie where query with or operator

armin200011

New Member
I have a \[code\]List<string> filterCriteria\[/code\] which contains one or multiple keywords to search a column in my database with based on user selection on the client side.The problem i have is that im not quite sure on how to build my linq to sql statement as it could have no 'or' operator or it could have multiple (10+).This is my original query\[code\]var originalQuery = (from p in productContext.Products select p);\[/code\]Then based on the list i need to query 'originalQuery' by the words in my \[code\]List<string> filterCriteria\[/code\] using or operators.E.g.\[code\] originalQuery = originalQuery.Where(p => p.ProductRange == "criteria1" || p.ProductRange == "criteria2");\[/code\]And so on...
 
Back
Top