Ejemplo n.º 1
0
        // GET: Hashtags/Details/5
        public ActionResult Details(int id)
        {
            try
            {
                return(View(_getOneHashtagCommand.Execute(id)));
            }
            catch (EntityNotFoundException e)
            {
                TempData["error"] = e.Message;
            }
            catch (Exception e)
            {
                TempData["error"] = e.Message;
            }

            return(RedirectToAction(nameof(Index)));
        }
Ejemplo n.º 2
0
 public ActionResult <HashtagDto> Get(int id)
 {
     try
     {
         return(Ok(_getOneHashtagCommand.Execute(id)));
     }
     catch (EntityNotFoundException e)
     {
         return(NotFound(e.Message));
     }
     catch (Exception e)
     {
         return(StatusCode(StatusCodes.Status500InternalServerError, e.Message));
     }
 }