internal class GetCountOfEntitiesByCriterionHibernateCallback : IHibernateCallback<int>
{
BaseDao<T> outer;
ICriterion criterion;
public GetCountOfEntitiesByCriterionHibernateCallback(BaseDao<T> outer, ICriterion criterion)
{
this.outer = outer;
this.criterion = criterion;
}
public int DoInHibernate(ISession session)
{
ICriteria criteria = session.CreateCriteria(typeof(T));
criteria.Add(this.criterion);//在新源码没有发布前请增加此句
return outer.GetCountOfEntitiesByCriteria(criteria);
}
}