Пример #1
0
        public HttpResponseMessage SavePrioridad([FromBody] Prioridad prioridad)
        {
            bool SuccesfullSaved = PrioridadHelper.Save(prioridad);

            if (!SuccesfullSaved)
            {
                throw new HttpResponseException(HttpStatusCode.InternalServerError);
            }

            return(Request.CreateResponse(HttpStatusCode.Created));
        }
Пример #2
0
        public HttpResponseMessage GetAllPrioridades()
        {
            List <Prioridad> list       = PrioridadHelper.GetAll();
            bool             TheresData = list.Count > 0;

            if (!TheresData)
            {
                throw new HttpResponseException(HttpStatusCode.NoContent);
            }

            return(Request.CreateResponse(HttpStatusCode.OK, list));
        }