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 } })); } }
public ActionResult Get(int id) { try { return(Ok(getActorCommand.Execute(id))); } catch (DataNotFoundException) { return(NotFound()); } catch (Exception) { return(StatusCode(500)); } }