mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 09:11:10 +00:00
Adds pagination and filtering to the API
This commit is contained in:
1 parent
ad984910a2
commit
ce4ebf36bc
59 files changed
+4423
-242
No files matched your search
@@ -18,7 +18,8 @@ public interface IBookRepository : IRepository<BookEntity>,
|
||||
IInsertRepositoryAction<BookEntity>,
|
||||
IUpdateRepositoryAction<BookEntity>,
|
||||
IGetByIdRepositoryAction<BookEntity, Guid>,
|
||||
IGetAllRepositoryAction<BookEntity>
|
||||
IGetAllRepositoryAction<BookEntity>,
|
||||
IGetPaginatedRepositoryAction<BookEntity>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets all the books of the media library identified by <paramref name="libraryId"/>.
|
||||
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Common.DataAccess.Entities.Common;
|
||||
using Lumina.Application.Common.DTO.Filtering;
|
||||
using Lumina.Application.Common.DTO.Pagination;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.Common;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.DataAccess.Repositories.Common.Actions;
|
||||
|
||||
/// <summary>
|
||||
/// Interface defining the "get paginated" action for interacting with a generic persistence medium.
|
||||
/// </summary>
|
||||
/// <typeparam name="TModel">The type used as a result for the "get paginated" action. It should implement <see cref="IStorageEntity"/>.</typeparam>
|
||||
public interface IGetPaginatedRepositoryAction<TModel> where TModel : IStorageEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets paginated data of type <typeparamref name="TModel"/> from the storage medium.
|
||||
/// </summary>
|
||||
/// <typeparam name="TFilter">The type of the filter carrying the criteria used to filter the results.</typeparam>
|
||||
/// <param name="paginationData">The pagination data that includes current page and number of items per page to retrieve. If <see langword="null"/>, all matching data is returned.</param>
|
||||
/// <param name="sortBy">The name of the field by which to sort the results.</param>
|
||||
/// <param name="sortOrder">The direction in which to sort the results.</param>
|
||||
/// <param name="filterModel">The model containing parameters used to filter results.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
/// <returns>An <see cref="Result{TValue}"/> containing either a paginated result of type <typeparamref name="TModel"/>, or an error.</returns>
|
||||
Task<Result<PaginatedResultDto<TModel>>> GetPaginatedAsync<TFilter>(PaginationDataDto? paginationData, string? sortBy = null, SortOrder? sortOrder = null, TFilter? filterModel = null, CancellationToken cancellationToken = default) where TFilter : BaseFilterDto;
|
||||
}
|
||||
Reference in new issue
Block a user