Ejemplo n.º 1
0
        public async Task <IActionResult> OnGetAsync([FromQuery(Name = "Query")] string query = "", [FromQuery(Name = "PageNumber")] int pageNumber = 1)
        {
            if (string.IsNullOrEmpty(query))
            {
                return(Page());
            }
            var qry    = new SearchArticlesQuery(query, pageNumber, ResultsPerPage);
            var result = await _mediator.Send(qry);

            SearchResult = _mapper.Map <SearchResultDto <ArticleSummary> >(result);

            return(Page());
        }
Ejemplo n.º 2
0
 public async Task <ActionResult <SearchArticlesOutputModel> > Search(
     [FromQuery] SearchArticlesQuery query)
 => await this.Send(query);