Language: C#
NHibernate Pagination via Extension Method
using System; using System.Collections.Generic; using System.Linq; using System.Text; using NHibernate; namespace Lucilla.Framework.Core.Data { public static class QueryExtensions { public static IQuery Paginate(this IQuery query, int pageIndex, int pageSize) { return query .SetFirstResult(pageIndex * pageSize) .SetMaxResults(pageSize); } } }
Tags:
Report Abuse
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search

