Projection in the Criteria API is a Hibernate V3 implementation. Since the current NHibernate version is based on the Hibernate V2 code it's not supported yet. There's an entry in JIRA to get it ported over, but unless you've got the time to do it yourself you'll need to wait for someone else.
On a side note, if you search the Hibernate forum you'll find that there were hacks out there for the Hibernate V2 to introduce support for getting count - I think they were pretty simple, so you could hack your version of NHibernate to add that support yourself.
Cheers,
Symon.
|