Scenario: I have a list of keywords, and I want to add a Linq Where clause to check if a Product object's description field contains ALL three keywords.
I am trying to add the following where clause to my query:
query = query.Where(product => keywords.All(product.Description.Contains));
query: is an IQueryable(Product) keywords: is a List Description: is a field in a product.
When I try to run this code I get an exception .NET Framework Data Provider error 1025.
I have also tried creating the expression seperately like so, as per other posts:
Expression<Func<Product, bool>> expr = product => keywords.All(product.Description.Contains);
query = query.Where(expr);
This gives the same error.
PS: Here is how I am declaring my IQueryable, just in case:
var query = from product in Entity.Products select product;