File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,22 @@ using NHibernate.Linq;]]></programlisting>
4242 .Where(c => c.Name == "Max")
4343 .ToList();]]> </programlisting >
4444
45+ <para >
46+ Starting with NHibernate 5.0, queries can also be created from an entity collection, with the standard
47+ Linq extension <literal >AsQueryable</literal > available from <literal >System.Linq</literal > namespace.
48+ </para >
49+ <programlisting >
50+ <![CDATA[ IList<Cat> whiteKittens =
51+ cat.Kittens.AsQueryable()
52+ .Where(k => k.Color == "white")
53+ .ToList();]]>
54+ </programlisting >
55+ <para >
56+ This will be executed as a query on that <literal >cat</literal >'s kittens without loading the
57+ entire collection.
58+ </para >
59+ <para > </para >
60+
4561 <para >
4662 A client timeout for the query can be defined.
4763 </para >
@@ -789,4 +805,4 @@ cfg.LinqToHqlGeneratorsRegistry<ExtendedLinqToHqlGeneratorsRegistry>();
789805 </para >
790806 </sect2 >
791807 </sect1 >
792- </chapter >
808+ </chapter >
You can’t perform that action at this time.
0 commit comments