Hi,
Today, to get a number of row on a "criteria", I use:
Code:
return session.CreateSQLQuery("select count(*) from users where id_profile = :idprofile")
.SetParameter("idprofile", (Int32)value, Hibernate.NHibernateUtil.Int32)
.UniqueResult<System.Int64>();
I have found the CountProjection class.
Is it a better way to get the count ?
Problem, if I code:
NHibernate.Expression.CountProjection count = new CountProjection();
I get an error on protection level for
NHibernate.Expression.CountProjection.CountProjection(string)
How to use this class please ?
Papy!