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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With