예제 #1
0
        public async Task <IActionResult> GetByAuthor(string name, int page = 1, int pageSize = 5)
        {
            Tuple <int, List <Article> > articles = await _articlesService.GetByAuthorName(name, page, pageSize);

            if (articles == null)
            {
                return(StatusCodeAndDtoWrapper.BuildGenericNotFound());
            }

            return(new StatusCodeAndDtoWrapper(ArticleListDtoResponse.Build(articles.Item2, "by_author/", page,
                                                                            pageSize, articles.Item1)));
        }