I have a paging worked with NHibernate:
public IEnumerable<Answer> GetAnswers(int page, int pageSize)
{
return HibernateTemplate.Execute(
session =>
{
var criteria = session.CreateCriteria(typeof(Answer));
return criteria
.SetFirstResult((page - 1) * pageSize)
.SetMaxResults(pageSize).List<Answer>();
}
);
}
Now my task is to determine on which page concrete Answer object is placed. How can i do it? Does nhibernate provide some info like index of row in result set?