Fixed
Details
Details
Assignee
Patrick Earl
Patrick EarlReporter
Kenneth Siewers Møller
Kenneth Siewers MøllerComponents
Fix versions
Affects versions
Priority
Who's Looking?
Open Who's Looking?
Created April 5, 2011 at 11:47 PM
Updated July 30, 2011 at 2:11 PM
Resolved April 6, 2011 at 8:13 AM
According to this post http://groups.google.com/group/castle-project-devel/browse_thread/thread/ac90148a8d4c8477
It seems it's a bug in NHibernate LinqExtensionMethods implementation. If
you take a look at LinqExtensionMethods.Query<T>(this ISession)
implementation in NHibernate souce code, it's currently implemented like
this:
public static IQueryable<T> Query<T>(this ISession session)
{
return new NhQueryable<T>(session as ISessionImplementor);
}
when it should be implemented like this:
public static IQueryable<T> Query<T>(this ISession session)
{
return new NhQueryable<T>(session.GetSessionImplementation());
}
The explanation is that in NHibernate SessionImpl, it inherits from
ISessionImplementor, while in NHibernateFacility SessionDelegate, it doesn't
inherit from ISessionImplementor. That's why when SessionDelegate cast back
to ISessionImplementor, it became null.