Exemplo n.º 1
0
        // DELETE: api/Book/5
        public HttpResponseMessage Delete(string carNumber)
        {
            bool deleteResult = CarManager.DeleteCarByCarNumber(carNumber);

            HttpStatusCode responseCode = deleteResult ? HttpStatusCode.OK : HttpStatusCode.BadRequest;

            return(new HttpResponseMessage(responseCode)
            {
                Content = new ObjectContent <bool>(deleteResult, new JsonMediaTypeFormatter())
            });
        }