I use Entity Framework 5 and i've a dynamic linq query. But i need i have to connect two conditions with "OR" operator. For example i can use this in normal sql text as this.
SELECT * FROM Products WHERE
(Keywords LIKE '%keyw1%' AND Keywords LIKE '%keyw2%') OR (ProdName LIKE '%ProdName%')
My linq query below. But i need create where conditions dynamically. How can i do this?
var prodQuery = from p in _db.Products
select p;
searchText.Split(' ')
.ForEach(
s =>
prodQuery =
prodQuery.Where(
p => p.Product.Keywords.Contains(s)));
//i need here "OR" operator. I have to connect this line with "OR" to upper condition
prodQuery = prodQuery.Where(p => p.ProdName.Contains("test prod"))