“The LINQ expression node type ‘Invoke’ is not supported in LINQ to Entities” – stumped!

I was getting this very error and I’m using Entity Framework with PredicateBuilder by Joe Albahari to build dynamic where clauses. If you happen to be in the same condition, you should call the AsExpandable method:

If querying with Entity Framework, change the last line to this:

return objectContext.Products.AsExpandable().Where(predicate);

This method is part of LINQKIT DLL that you can grab here or through a NuGet package here.

Everything works fine now. 🙂

Leave a Comment