public ActionResult Delete(int id)
        {
            Book orig = _booksService.GetBookById(id);

            if (orig != null)
            {
                _booksService.DeleteBook(orig);
            }
            return(Ok());
        }
Beispiel #2
0
        public async Task <ActionResult <Models.Book> > DeleteBook(int id)
        {
            if (id == null)
            {
                return(StatusCode(StatusCodes.Status404NotFound, "Could not found the ID: " + id));
            }

            var book = await _bookService.DeleteBook(id);

            if (book == null)
            {
                return(StatusCode(StatusCodes.Status404NotFound, "Could not found the ID: " + id));
            }

            return(book);
        }
Beispiel #3
0
 public IActionResult Delete(Guid id)
 {
     _booksService.DeleteBook(id);
     return(NoContent());
 }
 public void Delete(int id)
 {
     _booksService.DeleteBook(id);
 }
 public async Task DeleteBook(string bookID)
 {
     await _booksService.DeleteBook(bookID);
 }