Skip to content

Commit b5bf1b2

Browse files
NH-3386 - update documentation accordingly (and fix some typo, bad wording, ...)
1 parent 4955321 commit b5bf1b2

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

doc/reference/modules/query_linq.xml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
<para>
99
The Linq provider works as an extension of the <literal>ISession</literal>. It is defined in the
1010
<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.
11+
Linq provider. Of course, the Linq namespace is still needed too.
1212
</para>
1313
<programlisting><![CDATA[using System.Linq;
1414
using NHibernate.Linq;]]></programlisting>
1515
<para>
1616
Note: NHibernate has another querying API which uses lambda, <link linkend="queryqueryover">QueryOver</link>.
17-
It should not be confused with a LINQ provider.
17+
It should not be confused with a Linq provider.
1818
</para>
1919

2020
<sect1 id="querylinq-querystructure">
@@ -545,9 +545,10 @@ IList<Cat> cats =
545545
}
546546
}]]></programlisting>
547547
<para>
548-
It is required that at least one of the parameters of the method call has its value originating
549-
from an entity. Otherwise, the Linq provider will try to evaluate the method call with .Net
550-
runtime.
548+
The method call will always be translated to SQL if at least one of the parameters of the
549+
method call has its value originating from an entity. Otherwise, the Linq provider will try to
550+
evaluate the method call with .Net runtime instead. Since NHibernate 5.0, if this runtime
551+
evaluation fails (throws an exception), then the method call will be translated to SQL too.
551552
</para>
552553
</sect2>
553554

@@ -565,7 +566,7 @@ IList<Cat> cats =
565566
<para>&nbsp;</para>
566567
<para>
567568
As an example, here is how to add support for an <literal>AsNullable</literal> method which
568-
would allow to call aggregates which lay yield <literal>null</literal> without to explicitly
569+
would allow to call aggregates which may yield <literal>null</literal> without to explicitly
569570
cast to the nullable type of the aggregate.
570571
</para>
571572
<programlisting><![CDATA[public static class NullableExtensions
@@ -579,7 +580,7 @@ IList<Cat> cats =
579580
}
580581
}]]></programlisting>
581582
<para>
582-
Adding support in Linq to NHibernate for this custom method requires a generator. For this
583+
Adding support in Linq to NHibernate for a custom method requires a generator. For this
583584
<literal>AsNullable</literal> method, we need a method generator, declaring statically its
584585
supported method.
585586
</para>
@@ -612,8 +613,8 @@ IList<Cat> cats =
612613
</para>
613614
<para>
614615
For adding <literal>AsNullableGenerator</literal> in Linq to NHibernate provider, a new
615-
generators registry should be used. Derive from the default one and merge it. (Static
616-
declaration of method support case.)
616+
generators registry should be used. Derive from the default one and merge it. (Here we
617+
have a static declaration of method support case.)
617618
</para>
618619
<programlisting><![CDATA[public class ExtendedLinqToHqlGeneratorsRegistry :
619620
DefaultLinqToHqlGeneratorsRegistry

0 commit comments

Comments
 (0)