PagingAndSortingRepository
v1.0Description
Building upon features provided by CrudRepository<TEntity, TKey>
,
PagingAndSortingRepository<TEntity, TKey>
extends it by providing pagination features.
Methods
FindAll
Returns all entities of the current repository. This method provide many overloads to handle filtering, pagination and sorting, as well as their asynchronous counterparts.
Note: Asynchronous methods have the same name as their synchronous counterparts,
but with the
Async
suffix and return a Task
instead of the actual result.
You can also provide a CancellationToken
to cancel the operation.
IEnumerable<TEntity> FindAll(bool track = false);
IEnumerable<TEntity> FindAll(PageRequest page, bool track = false);
IEnumerable<TEntity> FindAll(PageRequest page, Expression<Func<TEntity, bool>> predicateFn, bool track = false);
IEnumerable<TEntity> FindAll<TOrderKey>(PageRequest page, Expression<Func<TEntity, TOrderKey>> orderKey, SortDirection sort = SortDirection.Ascending, bool track = false);
IEnumerable<TEntity> FindAll<TOrderKey>(PageRequest page, Expression<Func<TEntity, bool>> predicateFn, Expression<Func<TEntity, TOrderKey>> orderKey, SortDirection sort = SortDirection.Ascending, bool track = false);
Parameter | Description | Default value |
---|---|---|
page | The page request. | - |
predicateFn | The predicate function to filter the entities. | - |
orderKey | The order key selector. | - |
sort | The sort direction. You can refer to SortDirection | SortDirection.Ascending |
track | Indicates whether the entities returned by the method should be tracked by the context or not. | false |
Table of Contents