This is a simple and straightforward method I put in my base repositories to retrieve the row count of the results from an nhibernate criteria query.
protected int GetResultsCount(ICriteria criteria)
{
criteria.SetProjection(Projections.RowCount());
var eventsCount = criteria.UniqueResult<int>();
return eventsCount;
}

Categories
Tag Cloud
Blog RSS
Comments RSS
Last 50 Posts
Back
Void « Default
Life
Earth
Wind
Water
Fire
Light 