Exemplo n.º 1
0
        public HttpResponseMessage GetListOfItemsByMagId(Int32 id)
        {
            var list = listService.GetListOfItemsByMagazineId(id);

            if (list.Count == 0)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Lo sentimos, no hay listas para mostrar."));
            }

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