And no it is not proxy being casted to Project, the expression tree is converted into criteria and you're getting the exception at some level in this transformation.
Tuna Toksöz http://tunatoksoz.com http://twitter.com/tehlike Typos included to enhance the readers attention! On Thu, Feb 12, 2009 at 7:07 PM, Tuna Toksoz <[email protected]> wrote: > I guess the compiler produces some code with .Cast<Project> thing, which is > not implemented. > > Tuna Toksöz > http://tunatoksoz.com > http://twitter.com/tehlike > > Typos included to enhance the readers attention! > > > > On Thu, Feb 12, 2009 at 7:06 PM, Ben Scheirman <[email protected]>wrote: > >> Ahh, it's lazy so it's trying to cast the proxy to Project! >> >> >> On Thu, Feb 12, 2009 at 11:03 AM, Tuna Toksoz <[email protected]> wrote: >> >>> Ben can you try >>> >>> from p in session.Linq<Project> >>> select p >>> >>> without from Project p >>> >>> Tuna Toksöz >>> http://tunatoksoz.com >>> http://twitter.com/tehlike >>> >>> Typos included to enhance the readers attention! >>> >>> >>> >>> >>> On Thu, Feb 12, 2009 at 7:00 PM, Ben Scheirman <[email protected]>wrote: >>> >>>> I'm just digging into fluent nhibernate and nhibernate.linq, and I'm >>>> running into issues. >>>> I'm using NHibernate 2.0.1.4000, NHibernate.Linq 1.0, and >>>> FluentNhibernate (trunk). >>>> >>>> All of these projects seem to be referencing 2.0.1.4000 of Nhibernate, >>>> so I figured I was good. >>>> >>>> I have a single model (for now), mapped with the Automapper in >>>> fluent-nhib. >>>> >>>> Project >>>> -Id >>>> -Name >>>> -Code >>>> >>>> when I execute a simple linq query, like this: >>>> >>>> from Project p in Session.Linq<Project>() select p; >>>> >>>> it results in..... >>>> >>>> *The method Cast is not implemented.* * Description: *An unhandled >>>> exception occurred during the execution of the current web request. Please >>>> review the stack trace for more information about the error and where it >>>> originated in the code. >>>> >>>> * Exception Details: *System.NotImplementedException: The method Cast >>>> is not implemented. >>>> >>>> *Source Error:* >>>> >>>> Line 24: { >>>> Line 25: Logger.Info("Trying to execute linq query");Line 26: >>>> return (from Project p in Session.Linq<Project>() >>>> Line 27: select p).ToList(); >>>> >>>> >>>> >>>> *Stack Trace:* >>>> >>>> [NotImplementedException: The method Cast is not implemented.] >>>> >>>> NHibernate.Linq.Visitors.RootVisitor.VisitMethodCall(MethodCallExpression >>>> expr) +794 >>>> NHibernate.Linq.Visitors.ExpressionVisitor.Visit(Expression exp) +341 >>>> NHibernate.Linq.Visitors.NHibernateExpressionVisitor.Visit(Expression >>>> exp) +204 >>>> >>>> NHibernate.Linq.Visitors.RootVisitor.VisitMethodCall(MethodCallExpression >>>> expr) +40 >>>> NHibernate.Linq.Visitors.ExpressionVisitor.Visit(Expression exp) +341 >>>> NHibernate.Linq.Visitors.NHibernateExpressionVisitor.Visit(Expression >>>> exp) +204 >>>> >>>> NHibernate.Linq.Visitors.RootVisitor.VisitMethodCall(MethodCallExpression >>>> expr) +40 >>>> NHibernate.Linq.Visitors.ExpressionVisitor.Visit(Expression exp) +341 >>>> NHibernate.Linq.Visitors.NHibernateExpressionVisitor.Visit(Expression >>>> exp) +204 >>>> NHibernate.Linq.Visitors.NHibernateQueryTranslator.Translate(Expression >>>> expression, QueryOptions queryOptions) +85 >>>> NHibernate.Linq.NHibernateQueryProvider.Execute(Expression expression) >>>> +216 >>>> >>>> NHibernate.Linq.QueryProvider.System.Linq.IQueryProvider.Execute(Expression >>>> expression) +29 >>>> >>>> >>>> Anybody know what I'm doing wrong? I looked at AltOxite and they're >>>> running these same versions, so I think it's something I'm doing wrong. >>>> >>>> -Ben >>>> >>>> >>>> >>> >>> >>> >> >> >> >> > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" 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/group/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---
