public IHttpActionResult GetCapacidadeMaximaFuncionario() { int result = -1; try { result = PriIntegration.GetCapacidadeMaximaFuncionario(); } catch (InvalidOperationException e) { return(BadRequest(e.Message)); } catch (Exception) { return(InternalServerError()); } if (result < 0) { return(InternalServerError()); } else { Dictionary <string, int> response = new Dictionary <string, int>(); response.Add("capacidade", result); return(Ok(response)); } }