Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I take the "top n" using NHibernate Criteria API?

How do I take the "top n" using NHibernate Criteria API? Ideally I'd like to use detached criteria.

like image 958
Ben Aston Avatar asked Jul 20 '10 06:07

Ben Aston


1 Answers

something like:-

criteria.SetFirstResult(1);
criteria.SetMaxResults(10);

Will take the first 10 results.

like image 106
Rippo Avatar answered Oct 20 '22 00:10

Rippo