public ICriteria AddPaging(ICriteria criteria, GridDataRequest page) { if (page.ResultsPerPage > MaxCount) { page.ResultsPerPage = MaxCount; } criteria = criteria.SetFirstResult(page.ResultsToSkip()).SetMaxResults(page.ResultsPerPage); return(criteria); }
private IQueryable <TEntity> applyPaging(IQueryable <TEntity> queryable, GridDataRequest options) { return(queryable.Skip(options.ResultsToSkip()).Take(options.ResultsPerPage)); }