public IActionResult GetNewsItemById(int id) { //TODO: What if there is no item with this id ? var newsItem = _newsItemService.GetNewsItemById(id); if (newsItem == null) { return(BadRequest("No news item with this Id exists.")); } return(Ok(_newsItemService.GetNewsItemById(id))); }
public IActionResult getNewsItemsById(int id) { try { return(Ok(_newsItemService.GetNewsItemById(id))); } catch (ContentNotFoundException e) { return(NotFound(e.Message)); } }
public IActionResult GetNewsItemById(int id) { return(Ok(_newsItemService.GetNewsItemById(id))); }