Esempio n. 1
0
        // GET: Proizvod/Details/5
        public ActionResult Details(int id)
        {
            try
            {
                var p = _getProizvod.Execute(id);


                return(View(p));
            }
            catch (EntityNotFoundException e) { TempData["Error"] = e.Message; }
            catch (Exception e) { TempData["Error"] = "Server error " + e.Message; }
            return(View());
        }
Esempio n. 2
0
 public ActionResult <GetProizvodDTO> Get(int id)
 {
     try
     {
         var p = _getProizvod.Execute(id);
         return(StatusCode(200, p));
     }
     catch (EntityNotFoundException e)
     {
         return(NotFound(e.Message));
     }
     catch (Exception e)
     {
         return(StatusCode(500, e.Message));
     }
 }