public async Task <IActionResult> Get(int id) { var article = await _articlesRepository.GetSingleAsync(id); if (article == null) { return(NotFound()); // This makes it return 404; otherwise it will return a 204 (no content) } return(new ObjectResult(article)); }