コード例 #1
0
        public ActionResult Delete(int id)
        {
            Book orig = _booksService.GetBookById(id);

            if (orig != null)
            {
                _booksService.DeleteBook(orig);
            }
            return(Ok());
        }
コード例 #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);
        }
コード例 #3
0
 public IActionResult Delete(Guid id)
 {
     _booksService.DeleteBook(id);
     return(NoContent());
 }
コード例 #4
0
 public void Delete(int id)
 {
     _booksService.DeleteBook(id);
 }
コード例 #5
0
 public async Task DeleteBook(string bookID)
 {
     await _booksService.DeleteBook(bookID);
 }