using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Karsha_Site.Common { public static class Pagination { public static IEnumerable ToPaged(this IEnumerable source, int page, int pageSize, out int rowsCount) { rowsCount = source.Count(); return source.Skip((page - 1) * pageSize).Take(pageSize); } } }