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>
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 >
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
+
45
61
<para >
46
62
A client timeout for the query can be defined.
47
63
</para >
@@ -789,4 +805,4 @@ cfg.LinqToHqlGeneratorsRegistry<ExtendedLinqToHqlGeneratorsRegistry>();
789
805
</para >
790
806
</sect2 >
791
807
</sect1 >
792
- </chapter >
808
+ </chapter >
You can’t perform that action at this time.
0 commit comments