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 <[email protected]> wrote:
> On Thu, Mar 31, 2011 at 9:40 AM, Vladimir Kalinkin 
> <[email protected]>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
> ISession and IStatelessSession AFAIK. So SessionDelegate (nor
> StatelessSessionDelegate) wouldn't implement ISessionImplementor since they
> are external to NHibernate code base.
>
> Still, I'm not sure why it worked in NHibernate 3.0.
>
> --
> Regards,
>
> Maximilian Haru Raditya

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" 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/castle-project-users?hl=en.

Reply via email to