Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is NHibernate 3.1 Session Query Method?

I am a NHibernate novice to say the least.

I'm using NHibernate 3.1 and I'm trying to implement a generic repository using the generic session Query method. However, I cannot see it in my Visual Studio IDE Intellisense. I can only see QueryOver - which I'm not sure if it's meant to replace Query method. If so, why did they not leave Query but with a message indicating it has been deprecated as per convention?

Please someone help - I'll be eternally grateful.

Many thanks S.O.F community.

like image 330
Karis Sr. Avatar asked Apr 21 '11 22:04

Karis Sr.


1 Answers

It's not deprecated. They're different things. session.Query<T>() lets you use the LINQ provider, while QueryOver is a different API, also Expression based but actually more similar to the Criteria API.

As you already figured out, you need to open the NHibernate.Linq namespace to use the LINQ provider.

like image 164
Mauricio Scheffer Avatar answered Sep 25 '22 08:09

Mauricio Scheffer