コード例 #1
0
 // GET: Ad/Details/5
 public ActionResult Details(int id)
 {
     try
     {
         var ad = _getOneCommand.Execute(id);
         return(View(ad));
     }
     catch (Exception)
     {
         return(View());
     }
 }
コード例 #2
0
        public IActionResult Get(int id)
        {
            try
            {
                var adDto = _getOneCommand.Execute(id);

                return(Ok(adDto));
            }
            catch (EntityNotFoundException)
            {
                return(NotFound());
            }
        }