// DELETE: api/Book/5
        public HttpResponseMessage Delete(int id)
        {
            bool successfullDelete = bookDBHelper.DeleteBook(id);
            HttpResponseMessage response;

            if (successfullDelete)
            {
                response = Request.CreateResponse(HttpStatusCode.NoContent);
            }
            else
            {
                response = Request.CreateResponse(HttpStatusCode.NotFound);
            }
            return(response);
        }
Exemplo n.º 2
0
 public bool DeleteBook(Book book)
 {
     return(bookDBHelper.DeleteBook(book));
 }