コード例 #1
0
 public IActionResult Get(int id)
 {
     try
     {
         return(Ok(getActor.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
             }
         }));
     }
 }
コード例 #2
0
 public ActionResult Get(int id)
 {
     try
     {
         return(Ok(getActorCommand.Execute(id)));
     }
     catch (DataNotFoundException)
     {
         return(NotFound());
     }
     catch (Exception)
     {
         return(StatusCode(500));
     }
 }