Exemplo n.º 1
0
        public IHttpActionResult GetQuantidadeAvisos()
        {
            int result = -1;

            try {
                result = PriIntegration.GetNumeroAvisosPorLer();
            } catch (InvalidOperationException e) {
                return(BadRequest(e.Message));
            } catch (Exception) {
                return(InternalServerError());
            }

            if (result < 0)
            {
                return(InternalServerError());
            }

            Dictionary <string, int> resultBody = new Dictionary <string, int>();

            resultBody.Add("quantidade", result);

            return(Ok(resultBody));
        }