public JsonResult ObterConsulta(int id_consulta) { try { return(new JsonResult(_consultaService.Consulta(id_consulta)) { StatusCode = 200 }); } catch (ConsultaNaoExisteException exception) { return(new JsonResult(exception.Message) { StatusCode = 406 }); } catch (NaoFoiPossivelConectarNoBancoDeDadosException exception) { return(new JsonResult(exception.Message) { StatusCode = 406 }); } catch (Exception exception) { return(new JsonResult(exception.Message) { StatusCode = 500 }); } }