Class PaginationFilterExtensions
Provides static extension methods for working with pagination filter objects.
public static class PaginationFilterExtensions
- Inheritance
-
PaginationFilterExtensions
- Inherited Members
Methods
ApplyPagination<T>(IQueryable<T>, PaginationFilter?)
Applies pagination to the source queryable using the provided PaginationFilter, skipping the appropriate number of records and taking the requested page size. If the filter is null or contains an invalid page number (less than 0) or page size (not greater than 0), the original queryable is returned unchanged.
public static IQueryable<T> ApplyPagination<T>(this IQueryable<T> queryable, PaginationFilter? filter)
Parameters
queryableIQueryable<T>The source IQueryable<T> to paginate.
filterPaginationFilterThe pagination settings containing the page number and page size. If
nullor invalid, no pagination is applied.
Returns
- IQueryable<T>
The paginated IQueryable<T>, or the original queryable when the filter is
nullor contains invalid values.
Type Parameters
T