Monday, January 30, 2012

Best Extension Methods: Paging on IQueryable

Below extension methods allow easy way to perform paging on IQueryables.

public static IQueryable Page(this IQueryable source, int page, int pageSize)
    {
        return source.Skip((page - 1) * pageSize).Take(pageSize);
    }

Compiled By: Rajesh Rolen

Share This!


No comments:

Powered By Blogger · Designed By Seo Blogger Templates