.Invoke expression in Entity Framework?

Entity Framework does not support the Expression.Invoke statement. When you try to use it, you get the following exception:

"LINQ node expression of type" Invoke "is not supported in LINQ to Entities.

Does anyone have a workaround for this missing functionality? I would like to use the detailed PredicateBuilder here in the context of the Entity Framework.

Edit 1 @marxidad - I like your suggestion, however it confuses me somewhat. Can you give additional recommendations on the proposed solution?

Edit 2 @marxidad - Thanks for the clarification.

+28
linq linq-to-entities entity-framework
Aug 14 '08 at 0:24
source share
5 answers

PredicateBuilder and LINQKit now support Entity Framework.

Sorry guys for not doing this before!

+30
Apr 05 '09 at 4:56
source share

I posted the solution here

+4
Sep 25 '08 at 5:11
source share

Yes, it seems that the Entity Framework does not support this, and I could not use jerry-rig to make it evaluate how it works.

0
Aug 15 '08 at 16:17
source share

The Entity structure transforms LINQ expressions into Entity command trees, and only canonical functions are supported inside them. You will need to use command trees with canonical functions to do something like PredicateBuilder.

0
Aug 17 '08 at 22:06
source share

Phobis solution is on the money.

With little effort, you can create complex Dynamic LINQ queries on the fly using this approach

0
Oct 18 '08 at 1:24
source share



All Articles