Beispiel #1
0
        public HttpResponseMessage Delete(int id)
        {
            HttpResponseMessage responseMessage;
            JSendMessage        json;
            var response = _carModel.DeleteCar(id);

            if (response)
            {
                json            = new JSendMessage("success", "Car successfully deleted");
                responseMessage = Request.CreateResponse(HttpStatusCode.OK, json);
            }
            else
            {
                json            = new JSendMessage("fail", "Something bad happened");
                responseMessage = Request.CreateResponse(HttpStatusCode.BadRequest, json);
            }

            return(responseMessage);
        }