|
6 | 6 | for querying with NHibernate.
|
7 | 7 | </para>
|
8 | 8 | <para>
|
9 |
| - The Linq provider works as an extension of the <literal>ISession</literal>. It is defined in the |
10 |
| - <literal>NHibernate.Linq</literal> namespace, so this namespace has to be imported for using the |
11 |
| - Linq provider. Of course, the Linq namespace is still needed too. |
| 9 | + <literal>IQueryable</literal> queries are obtained with the <literal>Query</literal> methods used on the |
| 10 | + <literal>ISession</literal> or <literal>IStatelessSession</literal>. (Prior to NHibernate 5.0, these |
| 11 | + methods were extensions defined in the <literal>NHibernate.Linq</literal> namespace.) A number of |
| 12 | + NHibernate Linq extensions giving access to NHibernate specific features are defined in the |
| 13 | + <literal>NHibernate.Linq</literal> namespace. Of course, the Linq namespace is still needed too. |
12 | 14 | </para>
|
13 | 15 | <programlisting><![CDATA[using System.Linq;
|
14 | 16 | using NHibernate.Linq;]]></programlisting>
|
@@ -65,7 +67,9 @@ using NHibernate.Linq;]]></programlisting>
|
65 | 67 | <para> </para>
|
66 | 68 |
|
67 | 69 | <para>
|
68 |
| - A client timeout for the query can be defined. |
| 70 | + A client timeout for the query can be defined. As most others NHibernate specific features for |
| 71 | + Linq, this is available through an extension defined in <literal>NHibernate.Linq</literal> |
| 72 | + namespace. |
69 | 73 | </para>
|
70 | 74 | <programlisting><![CDATA[IList<Cat> cats =
|
71 | 75 | session.Query<Cat>()
|
@@ -453,7 +457,8 @@ if (catCount.Value > 10)
|
453 | 457 | <para>
|
454 | 458 | A Linq query may load associated entities or collection of entities. Once the query is defined, using
|
455 | 459 | <literal>Fetch</literal> allows fetching a related entity, and <literal>FetchMany</literal> allows
|
456 |
| - fetching a collection. |
| 460 | + fetching a collection. These methods are defined as extensions in <literal>NHibernate.Linq</literal> |
| 461 | + namespace. |
457 | 462 | </para>
|
458 | 463 | <programlisting><![CDATA[IList<Cat> oldCats =
|
459 | 464 | session.Query<Cat>()
|
|
0 commit comments