You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace Karsha_Site.Common
  7. {
  8. public static class Pagination
  9. {
  10. public static IEnumerable<TSource> ToPaged<TSource>(this IEnumerable<TSource> source, int page, int pageSize, out int rowsCount)
  11. {
  12. rowsCount = source.Count();
  13. return source.Skip((page - 1) * pageSize).Take(pageSize);
  14. }
  15. }
  16. }