コード例 #1
0
        public HttpResponseMessage Remove(int id)
        {
            try
            {
                var cartitembs = new CartItemBusiness();


                cartitembs.Borrar(id);

                var httpok = new HttpResponseMessage()
                {
                    StatusCode   = (HttpStatusCode)200,
                    ReasonPhrase = "Item Eliminado"
                };
                return(httpok);
            }
            catch (Exception ex)
            {
                var httpError = new HttpResponseMessage()
                {
                    StatusCode   = (HttpStatusCode)422,
                    ReasonPhrase = ex.Message
                };

                throw new HttpResponseException(httpError);
            }
        }