Skip to content

Commit

Permalink
Updated paging
Browse files Browse the repository at this point in the history
  • Loading branch information
michael.stevenson committed Sep 2, 2021
1 parent 1cfdebb commit 5052823
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ protected override Result<PagedResult<InstitutionDto>> Handle(GetAllQuery reques
{
var pagination = _mapper.Map<PaginationDetails>(request).WithTotal(_instituitonContext.Institution.Count());

var audits = _mapper.ProjectTo<InstitutionDto>(_instituitonContext.Institution.Include(a => a.Address)).OrderBy(a => a.Name)
var schools = _mapper.ProjectTo<InstitutionDto>(_instituitonContext.Institution.Include(a => a.Address)).OrderBy(a => a.Name)
.Skip(pagination.PreviousPageNumber * pagination.PageSize)
.Take(request.PageSize).ToList();

var paginationResponse = PagedResult<InstitutionDto>.CreatePaginatedResponse(_uriService, pagination, audits);
var paginationResponse = PagedResult<InstitutionDto>.CreatePaginatedResponse(_uriService, pagination, schools);

return Result.Ok(paginationResponse);
}
Expand Down

0 comments on commit 5052823

Please sign in to comment.