Hi,
I'm trying to use NHibernate for the first time. Most of the sample code and sandbox stuff I'm doing to learn the framework seems to work okay, so I assume my mappings are correct, but I can't get projections to work.
Here's the code:
Code:
Dim crit As ICriteria = session.CreateCriteria(GetType(DataTransferObjects.Product))
crit.SetProjection(Projections.ProjectionList)
crit.Add( projections.RowCount()) )
Dim products As System.Collections.IList = crit.List()
The error gets thrown on crit.Add() and is:
Code:
Unable to cast object of type 'NHibernate.Criterion.RowCountProjection' to type 'NHibernate.Criterion.ICriterion'.
Any suggestions?