Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NHibernate.ISession does not contain a definition for Linq

I'm using NHibernate latest builds but unable to work with linq. I already added using NHibernate.Linq, so that's not the issue.

using (ISession session = NHibernateHelper.OpenSession())
{
    var sss = session.Linq<Category>().ToArray(); <-- Error mentioned above.
}

Looks like there is no extention method Linq() for ISession, despite the fact thath NHibernate.Linq is in uses list. Any idea?

Thanks

like image 777
Davita Avatar asked Jan 22 '11 13:01

Davita


1 Answers

session.Linq<T>() is for the contrib provider for NHibernate 2.x

session.Query<T>() is for the built-in provider in NHibernate 3.x

like image 94
Mauricio Scheffer Avatar answered Nov 13 '22 14:11

Mauricio Scheffer