// GET: Comments/Details/5 public ActionResult Details(int id) { try { var comment = _getOneCommand.Execute(id); return(View(comment)); } catch (Exception) { return(View()); } }
public IActionResult Get(int id) { try { return(Ok(getComment.Execute(id))); } catch (EntityNotFoundException e) { return(NotFound(new { Errors = new List <string> { e.Message } })); } catch (Exception e) { return(StatusCode(500, new { Errors = new List <string> { e.Message } })); } }
// GET: Comments/Details/5 public ActionResult Details(int id) { try { return(View(_getOneCommentCommand.Execute(id))); } catch (EntityNotFoundException e) { TempData["error"] = e.Message; } catch (Exception e) { TempData["error"] = e.Message; } return(RedirectToAction(nameof(Index))); }
// GET: Comment/Details/5 //[LoggedIn] public ActionResult Details(int id) { try { var dto = _getCommentCommand.Execute(id); return(View(dto)); } catch (EntityNotFoundException ex) { TempData["error"] = ex.Message; } catch (Exception e) { TempData["greska"] = "Doslo je do greske."; } return(View()); }
public IActionResult Get(int id) { try { var commentDto = _getOneCommand.Execute(id); return(Ok(commentDto)); } catch (EntityNotFoundException) { return(NotFound()); } }
public ActionResult <CommentDto> Get(int id) { try { var dto = _getCommentCommand.Execute(id); return(Ok(dto)); } catch (EntityNotFoundException) { return(NotFound()); } }
public ActionResult <IEnumerable <CommentDTO> > Get(int id) { try { var commentDTO = _getCommentCommand.Execute(id); return(Ok(commentDTO)); } catch (EntityNotFoundException) { return(NotFound()); } }
public ActionResult <CommentDto> Get(int id) { try { return(Ok(_getOneCommentCommand.Execute(id))); } catch (EntityNotFoundException e) { return(NotFound(e.Message)); } catch (Exception e) { return(StatusCode(StatusCodes.Status500InternalServerError, e.Message)); } }
public ActionResult Get(int id) { try { return(Ok(getCommentCommand.Execute(id))); } catch (DataNotFoundException) { return(NotFound()); } catch (Exception) { return(StatusCode(500)); } }
public IActionResult Get(int id) { try { var comment = _getOneCommand.Execute(id); return(Ok(comment)); } catch (EntityNotFoundException) { return(NotFound()); } catch (Exception) { return(StatusCode(500, "An Error Occured")); } }
public ActionResult <CreateCommentDto> Get(int id) { try { var comment = _getOne.Execute(id); return(Ok(comment)); } catch (EntityNotFoundException e) { return(NotFound(e.Message)); } catch (Exception e) { return(StatusCode(500, e.Message)); } }
public ActionResult Get(int id) { try { var one = _getOneCommand.Execute(id); return(Ok(one)); } catch (EntityNotFoundException e) { return(NotFound(e.Message)); } catch (Exception) { return(StatusCode(500, "Server error has occurred.")); } }
public ActionResult Edit(int id) { var response = _getCommentCommand.Execute(id); return(View(response)); }
// GET: Comment/Details/5 //[LoggedIn] public ActionResult Details(int id) { var dto = _getCommentCommand.Execute(id); return(View(dto)); }