NHibernate-Donde ISession.Query () se encuentra



Cuando intento compilar el siguiente código

using System;
using System.Collections.Generic;
using System.Reflection;
using System.Linq;
using NHibernate;

namespace NewNHTest
{
    class A
    { }

    class Program
    {
        static void Main(string[] args)
        {
            ISession session;
            var q = session.Query<A>();
        }
    }
}

Obtengo el siguiente error:

'NHibernate.ISession' does not contain a definition for 'Query' and no extension method 'Query' accepting a first argument of type 'NHibernate.ISession' could be found (are you missing a using directive or an assembly reference?)

NHibernate.la versión dll es 3.0.0.4000.
La versión. Net del proyecto es 3.5.

¿Qué estoy haciendo mal?
Gracias por su ayuda!

Author: StuffHappens, 2011-01-12

1 answers

ISession.Query

Es nuevo en NHibernate 3 y es un método de extensión. Try

using NHibernate.Linq

Y debe resolverse bien.

 48
Author: Stephan Schinkel,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-10-30 15:35:10