The query below works for explicitly mapped entities but not for interfaces (even though that same interface works in other queries)
Code:
Session.CreateCriteria(typeof(ILoanProtectable)) .SetProjection(Projections.RowCount()).UniqueResult<int>();
I get this error:
NHibernate.NonUniqueResultException: query did not return a unique result: 2
... sorry as I was pressing 'submit' I realised what it's doing.
It's returning a list of all the entity counts. So I have to iterate through the resulting list and count the total of each.