예제 #1
0
        public HttpResponseMessage Post([FromBody] Item item)
        {
            var result = _shoppingListService.CreateItem(item);

            if (result != null)
            {
                return(Request.CreateResponse(HttpStatusCode.OK, item));
            }
            return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Item not created"));
        }