Ejemplo n.º 1
0
        public HttpResponseMessage Get(string type, int id)
        {
            try
            {
                List <SelectListItem> list = ListService.GetArticles(id, _articleRepository);

                if (list == null)
                {
                    return(Request.CreateResponse(HttpStatusCode.NoContent));
                }

                return(Request.CreateResponse(HttpStatusCode.OK, list));
            }
            catch (Exception ex)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex));
            }
        }