public async Task <PageWithMetaData <User> > Handle(ListUsersRequest request, CancellationToken cancellationToken) { var page = await _context.Users.ToPagedListAsync(request.PageNumber, request.PageSize, cancellationToken); return(new PageWithMetaData <User> { Items = page, PageDetails = page.GetMetaData() }); }
public async Task <ActionResult <PagedList <User> > > Index([FromQuery] ListUsersRequest request) { var response = await _mediator.Send(request); return(Ok(response)); }