Obsolete code in the tips 'n tricks
-----------------------------------
Key: NH-780
URL: http://jira.nhibernate.org/browse/NH-780
Project: NHibernate
Type: Improvement
Components: Documentation
Versions: 1.2.0.Beta1
Reporter: Guy Mahieu
Priority: Trivial
>From the docs:
<blockquote/>
11.13. Tips & Tricks
You can count the number of query results without actually returning them:
<code>
IEnumerator countEn = session.Enumerable("select count(*) from ....").GetEnumerator();
countEn.MoveNext();
int count = (int) countEn.Current;
</code>
</blockquote>
Other than looking like a workaround, this uses obsolete code (session.Enumerable); it might be better to change it to:
<code>
int count = (int) session.CreateQuery("select count(*) from ...").UniqueResult();
</code>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.nhibernate.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
|