Thank you. As you see I use "Collection" (I'm sorry, it is wrapper for
Session.Query<User>()), instead of this now I'm using something like
this:
public static IQueryable<T> Collection
{
get
{
return new NhQueryable<T>(session.GetSessionImplementation());
}
}
On Mar 31, 7:52 am, Maximilian Raditya <
m4h...@gmail.com> wrote:
> On Thu, Mar 31, 2011 at 9:40 AM, Vladimir Kalinkin <
cyberkal...@gmail.com>wrote:
>
> > We have session=null after:
>
> > public static IQueryable<T> Query<T>(this ISession session)
> > {
> > return new NhQueryable<T>(session as ISessionImplementor);
> > }
>
> I think you should try this instead:
>
> public static IQueryable<T> Query<T>(this ISession session)
> {
> return new NhQueryable<T>(*session.GetSessionImplementation()*);
>
> }
>
> Internally in NHibernate code base, that's how
> DetachedCriteria.GetExecutableCriteria(ISession) works.
>
> Also ISessionImplementor is for NHibernate *internal *session
> implementation. The *external *interfaces for accessing session are only