Creating a query with two roots like that is not supported by the Criteria API with which the LINQ implementation is based.
On Sun, May 3, 2009 at 3:10 PM, Action Jackson <[email protected]> wrote: > > I'm getting an error in which I cannot tell if it's a result of a > bug or just a badly written query on my part. Here is my query: > > var q = from student in Session.Linq<Student>() > from user in Session.Linq<User>() > select student; > > The Employee poco has a foreign key reference to a table containing > PersonInformation. The error I am getting is this: > > Unable to cast object of type > 'System.Linq.Expressions.ConstantExpression' to type > 'System.Linq.Expressions.LambdaExpression'. > > This exception is being thrown as a result of the following logic in > the HandleSelectManyCall method of the RootVisitor class : > > //get the association path for the joined entity > var collectionSelector = (LambdaExpression)LinqUtil.StripQuotes > (call.Arguments[1]); > > Apparently, for my query, LinqUtil.StripQuotes(call.Arguments[1]); > returns a ConstantExpression instead of the LambdaExpression that the > above code assumes it will be. 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 -~----------~----~----~----~------~----~------~--~---
