What's wrong with this query
Hi,
I have an error message I don't understand with some of my queries.
I tried to simplify it as much as possible to reproduce the error:
from c in Employees
from p in Employees
select new { c, p}
This query (admitedly stupid) works fine in VS by returns a weird error message in LinqPad.
The message is :
NotSupportedException: Impossible to create a constant value of type « DAL.Employee ». Only primitive types or enums are allowed in this context. (Translated from french message)
What am I doing wrong?
TIA
Philippe
I have an error message I don't understand with some of my queries.
I tried to simplify it as much as possible to reproduce the error:
from c in Employees
from p in Employees
select new { c, p}
This query (admitedly stupid) works fine in VS by returns a weird error message in LinqPad.
The message is :
NotSupportedException: Impossible to create a constant value of type « DAL.Employee ». Only primitive types or enums are allowed in this context. (Translated from french message)
What am I doing wrong?
TIA
Philippe
Comments
Thanks for the answer.
I tried again with a direct connection to my SQL database and it actually worked.
My problem occurs when I connect to an Entity Framework DbContext I have created (new ADO NET Entity Data Model).
Any ideas ...
Philippe
I'm getting the same error with very similar query and I'm also using Entity Framework DbContext connection. And it also works fine in VS.
Just bought full license, but not being able to use LinqPad due to this error with very basic query... Is there any workaround to this issue?