LINQ: Entity string field contains any of an array of strings

Since you want to see if search contains a word which is contained in the description of p you basically need to test for each value in search if it is contained in the description of p

result = from p in products
           where search.Any(val => p.Description.Contains(val))
           select p;

This is c# syntax for the lambda method since my vb is not that great

Leave a Comment