Today I've moved to using NHibernate Facility 2RC & NHibernate 3.1
instead of NH3.0 & previous version of NH Facility
I have simple query

            var query = from u in Collection
                        where u.Email == email
                        select u;
            return query.Single();

It throws NullReferenceException here (d:\CSharp\NH\NH\NHibernate\src
\NHibernate\Linq\NhQueryProvider.cs):

private NhLinqExpression PrepareQuery(Expression expression, out
IQuery query, out NhLinqExpression nhQuery)
            {
                var nhLinqExpression = new NhLinqExpression(expression);

                query = _session.CreateQuery(nhLinqExpression); //
_session==null !!

                nhQuery =
query.As<ExpressionQueryImpl>().QueryExpression.As<NhLinqExpression>();

                SetParameters(query, nhLinqExpression.ParameterValuesByName);
                SetResultTransformerAndAdditionalCriteria(query, nhQuery,
nhLinqExpression.ParameterValuesByName);
                return nhLinqExpression;
            }

We have session=null after:

public static IQueryable<T> Query<T>(this ISession session)
        {
            return new NhQueryable<T>(session as ISessionImplementor);
        }

In NH 3.0 it was:

        public static IQueryable<T> Query<T>(this ISession session)
        {
            return new NhQueryable<T>(session);
        }

Every time we use SessionDelegate from the Facility which doesn't
implement interface ISessionImplementor.

Do you have any ideas how to resolve this issue?


-- 
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