Пример #1
0
        public async Task <PageWithMetaData <Question> > Handle(ListQuestionRequest request, CancellationToken cancellationToken)
        {
            var page = await _context.Questions.ToPagedListAsync(request.PageNumber, request.PageSize, cancellationToken);

            return(new PageWithMetaData <Question>
            {
                Items = page,
                PageDetails = page.GetMetaData()
            });
        }
        public async Task <ActionResult <PagedList <Question> > > Index([FromQuery] ListQuestionRequest request)
        {
            var response = await _mediator.Send(request);

            return(Ok(response));
        }