// GET: News/Details/5 public ActionResult Details(int id) { try { var dto = _getNewCommand.Execute(id); return(View(dto)); } catch (EntityNotFoundException ex) { TempData["error"] = ex.Message; } catch (Exception e) { TempData["greska"] = "Doslo je do greske."; } return(View()); }
public ActionResult <NewsDto> Get(int id) { try { var dto = _getNewCommand.Execute(id); return(Ok(dto)); } catch (EntityNotFoundException) { return(NotFound()); } }