コード例 #1
0
        public async Task <IActionResult> GetArticles([FromQuery] ArticleParams articleParams)
        {
            int pageSize  = articleParams.PageSize;
            int pageIndex = articleParams.PageIndex;

            var articlesFromRepo = await _repo.GetArticlesAsync(articleParams);

            var articles = _mapper.Map <IEnumerable <ArticleToReturnDto> >(articlesFromRepo);

            return(Ok(new { articles, articleParams.Length }));
        }