NHibernate paging with SQL Server
问题 When using SetFirstResult(start) and SetMaxResults(count) methods to implement paging I've noticed that the generated query only does a select top count * from some_table and it does not take the start parameter into account or at least not at the database level. It seems that if I instruct NHibernate to execute the following query: var users = session.CreateCriteria<User>() .SetFirstResult(100) .SetMaxResults(5) .List<User>(); 105 records will transit between the database server and the