add the option to override pagination rules
This commit is contained in:
parent
ef30ef5fb5
commit
538537f2a7
|
|
@ -139,6 +139,11 @@ namespace NejCommon.Controllers
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected virtual Task<PaginationResponse<TGetAllResponse>> ApplyPagination(IQueryable<TType> query, Pagination pag)
|
||||||
|
{
|
||||||
|
return query.ApplyPaginationRes<TType, TGetAllResponse>(providers, pag);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get all the <typeparamref name="TType"/>
|
/// Get all the <typeparamref name="TType"/>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -147,7 +152,7 @@ namespace NejCommon.Controllers
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public virtual async Task<Results<BadRequest<Error>, Ok<PaginationResponse<TGetAllResponse>>>> GetAll([FromServices] TOwner company, [FromQuery] Pagination pag)
|
public virtual async Task<Results<BadRequest<Error>, Ok<PaginationResponse<TGetAllResponse>>>> GetAll([FromServices] TOwner company, [FromQuery] Pagination pag)
|
||||||
{
|
{
|
||||||
var data = await ApplyDefaultOrdering(GetQuery(company)).AsNoTrackingWithIdentityResolution().ApplyPaginationRes<TType, TGetAllResponse>(providers, pag);
|
var data = await ApplyPagination(ApplyDefaultOrdering(GetQuery(company)).AsNoTrackingWithIdentityResolution(), pag);
|
||||||
|
|
||||||
//Console.Writeline(data.Data);
|
//Console.Writeline(data.Data);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user