I am trying to use linqkit to Predicate. Getting following code when I am trying to compile.
public void TestPredicate(Guid[] productIds)
{
var predicate = PredicateBuilder.False<Product>();
foreach (var productId in productIds)
{
var tempGuid = productId;
predicate = predicate.Or(p => p.ProductId== tempGuid);
}
}
var query = from p in context.CreateQuery("product")
.AsExpandable().Where(predicate) select p;
}
Error 1: 'System.Linq.IQueryable' does not contain a definition for 'Where' and the best extension method overload 'System.Linq.Queryable.Where(System.Linq.IQueryable, System.Linq.Expressions.Expression>)' has some invalid arguments
Error 2 Argument 2: cannot convert from 'System.Linq.Expressions.Expression>' to 'System.Linq.Expressions.Expression>
Please suggest me what I need to do fix it.
Thanks
I believe you are using Dynamics CRM. So following should work for you.