I need to do the following for the purposes of paging a query in nHibernate:
Select count(*) from
(Select e.ID,e.Name from Object as e where...)
Solved My own question by modifying Geir-Tore's answer.....
IList results = session.CreateMultiQuery()
.Add(session.CreateQuery("from Orders o").SetFirstResult(pageindex).SetMaxResults(pagesize))
.Add(session.CreateQuery("select count(distinct e.Id) from Orders o where..."))
.List();
return results;