private static void SetPagination(IDetachedQuery query, int pageSize, int pageNumber) { if (query == null) { throw new ArgumentNullException("query"); } query.SetFirstResult(pageSize * (pageNumber < 1 ? 0 : pageNumber - 1)).SetMaxResults(pageSize); }
private static void ResetPagination(IDetachedQuery query) { if (query == null) { throw new ArgumentNullException("query"); } query.SetFirstResult(default(int)).SetMaxResults(RowSelection.NoValue); }