Created
January 18, 2012 17:56
-
-
Save philjones88/1634476 to your computer and use it in GitHub Desktop.
RavenDB Paging
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class QueryableExtensions | |
{ | |
public static IQueryable<T> Paging<T>(this IQueryable<T> query, int currentPage, int defaultPage, int pageSize) | |
{ | |
return query | |
.Skip((currentPage - defaultPage) * pageSize) | |
.Take(pageSize); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment