PagingAndSortingRepository

v1.0

Description


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);
ParameterDescriptionDefault value
pageThe page request.-
predicateFnThe predicate function to filter the entities.-
orderKeyThe order key selector.-
sortThe sort direction. You can refer to SortDirectionSortDirection.Ascending
trackIndicates whether the entities returned by the method should be tracked by the context or not.false
Table of Contents