Class PaginationExtensions
- Namespace
- Olve.Utilities.Paginations
- Assembly
- Olve.Utilities.dll
Applies a Pagination or OffsetPagination to a sequence.
public static class PaginationExtensions
- Inheritance
-
PaginationExtensions
- Inherited Members
Methods
Paginate<T>(IEnumerable<T>, OffsetPagination)
Returns the slice of source described by pagination, together
with the total number of items in source.
public static Slice<T> Paginate<T>(this IEnumerable<T> source, OffsetPagination pagination)
Parameters
sourceIEnumerable<T>The items to paginate. Enumerated once.
paginationOffsetPaginationThe slice to take.
Returns
- Slice<T>
The requested slice.
Type Parameters
TThe type of the items.
Exceptions
Paginate<T>(IEnumerable<T>, Pagination)
Returns the page of source described by pagination, together
with the total number of items in source.
public static Page<T> Paginate<T>(this IEnumerable<T> source, Pagination pagination)
Parameters
sourceIEnumerable<T>The items to paginate. Enumerated once.
paginationPaginationThe page to take.
Returns
- Page<T>
The requested page.
Type Parameters
TThe type of the items.
Exceptions
Paginate<T>(IQueryable<T>, OffsetPagination)
Returns the slice of source described by pagination, together
with the total number of items in source. The count, skip and take are composed
onto the query, so query providers such as Entity Framework translate them.
public static Slice<T> Paginate<T>(this IQueryable<T> source, OffsetPagination pagination)
Parameters
sourceIQueryable<T>The query to paginate. Executed twice: once to count, once to fetch the slice.
paginationOffsetPaginationThe slice to take.
Returns
- Slice<T>
The requested slice.
Type Parameters
TThe type of the items.
Exceptions
Paginate<T>(IQueryable<T>, Pagination)
Returns the page of source described by pagination, together
with the total number of items in source. The count, skip and take are composed
onto the query, so query providers such as Entity Framework translate them.
public static Page<T> Paginate<T>(this IQueryable<T> source, Pagination pagination)
Parameters
sourceIQueryable<T>The query to paginate. Executed twice: once to count, once to fetch the page.
paginationPaginationThe page to take.
Returns
- Page<T>
The requested page.
Type Parameters
TThe type of the items.