public IActionResult GetArticle([FromRoute] int id) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var article = _articlesRepository.Find(id); if (article == null) { return(NotFound()); } return(Ok(article)); }
public async Task <IEnumerable <ArticleDto> > Handle(GetAllArticles request, CancellationToken cancellationToken) { var articles = await _articlesRepository.Find(); return(articles.AsDto()); }