NHibernate: How to select the root entity in a projection
问题 Ayende describes a really great way to get page count, and a specific page of data in a single query here: http://ayende.com/blog/2334/paged-data-count-with-nhibernate-the-really-easy-way His method looks like: IList list = session.CreateQuery("select b, rowcount() from Blog b") .SetFirstResult(5) .SetMaxResults(10) .List(); The only problem is this example is in HQL, and I need to do the same thing in an ICriteria query. To achieve the equivalent with ICriteria, I need to do something like: