public IQueryable <T> Process(IQueryable <T> items) { _pager.Initialize(items); //init pager if (_pager.CurrentPage <= 0) { return(items); //incorrect page } int skip = (_pager.CurrentPage - 1) * _pager.PageSize; return(items.Skip(skip).Take(_pager.PageSize)); }
public IEnumerable <T> Process(IDataQueryable <T> items) { _pager.Initialize(items); //init pager int currentPage = _pager.CurrentPage; if (currentPage <= 0) { currentPage = 1; } int skip = (currentPage - 1) * _pager.PageSize; return(items.Fetch(skip, _pager.PageSize)); }
public IQueryable <T> Process(IQueryable <T> items, int count) { _pager.Initialize(count); return(Process(items)); }