Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Bootstrapper/Controllers/v1/BrandsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public BrandsController(IBrandService service)

[HttpGet]
[MustHavePermission(Permissions.Brands.ListAll)]
public async Task<IActionResult> GetListAsync(BrandListFilter filter)
public async Task<IActionResult> GetListAsync([FromQuery]BrandListFilter filter)
{
var productDetails = await _service.GetBrandsAsync(filter);
return Ok(productDetails);
Expand Down
2 changes: 1 addition & 1 deletion src/Bootstrapper/Controllers/v1/ProductsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public async Task<IActionResult> GetAsync(Guid id)

[HttpGet]
[MustHavePermission(Permissions.Products.ListAll)]
public async Task<IActionResult> GetListAsync(ProductListFilter filter)
public async Task<IActionResult> GetListAsync([FromQuery]ProductListFilter filter)
{
var productDetails = await _service.GetProductsAsync(filter);
return Ok(productDetails);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public async Task<TDto> GetByIdAsync<T, TDto>(Guid entityId, BaseSpecification<T
}
}

public async Task<PaginatedResult<TDto>> GetPaginatedListAsync<T, TDto>(int pageNumber, int pageSize, string[] orderBy = null, Search search = null, Expression<Func<T, bool>> expression = null, CancellationToken cancellationToken = default)
public async Task<PaginatedResult<TDto>> GetPaginatedListAsync<T, TDto>(int pageNumber, int pageSize = int.MaxValue, string[] orderBy = null, Search search = null, Expression<Func<T, bool>> expression = null, CancellationToken cancellationToken = default)
where T : BaseEntity
where TDto : IDto
{
Expand Down
5 changes: 5 additions & 0 deletions src/Shared/Shared.DTOs/Filters/PaginationFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ namespace DN.WebApi.Shared.DTOs.Filters
{
public abstract class PaginationFilter : BaseFilter
{
public PaginationFilter()
{
PageSize = int.MaxValue;
}

public int PageNumber { get; set; }

public int PageSize { get; set; }
Expand Down