I'm trying to analyze a trivial Linq query and I'm getting a strange
error that I can't figure out.  Here is my query:

var q = from e in Session.Linq<Employee>()
          from ei in Session.Linq<EmployeeInformation>()
          select e;

object o = q.ElementAtOrDefault(0); // this my code that produces the
issue

I'm getting an InvalidCastException:

Unable to cast object of type
'System.Linq.Expressions.ConstantExpression' to type
'System.Linq.Expressions.LambdaExpression'.

The invalid cast occurs in the HandleSelectManyCall method within the
RootVisitor class.  The specifc line is below:

//get the association path for the joined entity
var collectionSelector = (LambdaExpression)LinqUtil.StripQuotes
(call.Arguments[1]);

Any ideas?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"NHibernate Contrib - Development Group" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com.ar/group/nhcdevs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to