File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,20 @@ using NHibernate.Linq;]]></programlisting>
42
42
.Where(c => c.Name == "Max")
43
43
.ToList();]]> </programlisting >
44
44
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 ><![CDATA[ IList<Cat> whiteKittens =
50
+ cat.Kittens.AsQueryable()
51
+ .Where(k => k.Color == "white")
52
+ .ToList();]]> </programlisting >
53
+ <para >
54
+ This will be executed as a query on that <literal >cat</literal >'s kittens without loading the
55
+ entire collection.
56
+ </para >
57
+ <para > </para >
58
+
45
59
<para >
46
60
A client timeout for the query can be defined.
47
61
</para >
@@ -789,4 +803,4 @@ cfg.LinqToHqlGeneratorsRegistry<ExtendedLinqToHqlGeneratorsRegistry>();
789
803
</para >
790
804
</sect2 >
791
805
</sect1 >
792
- </chapter >
806
+ </chapter >
You can’t perform that action at this time.
0 commit comments