Monday, August 22, 2011

Paging in LINQ


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

No comments:

Post a Comment