Linq and Canonical Function problem

Damir Dobric Posts

Next talks:

 

    

Follow me on Twitter: #ddobric



 

 

Archives

If you run the code below, following error appear:
The 'Invoke' LINQ expression node type is not supported by LINQ to Entities.

image

The problem is that Entity Framework does not provide mapping of same expression like method invocation.
This post describes the CLR Method to Canonical Function Mapping in more details: http://msdn.microsoft.com/en-us/library/bb738681.aspx.
To solve this specific case shown in the example above, the solution is supply in select-command something,
what can be understood by LINQ-provider. That is, you cannot invoke the method, but you can create the
object which internally invoke the method you need.

image

 

image


Posted Jun 27 2008, 01:20 PM by Damir Dobric
developers.de is a .Net Community Blog powered by daenet GmbH.