Example #1
0
        public ActionResult DeleteBookForAuthor(Guid authorId, Guid bookId)
        {
            if (!_restApiRepository.AuthorExists(authorId))
            {
                return NotFound();
            }

            var bookForAuthorFromRepo = _restApiRepository.GetBook(authorId, bookId);
            if (bookForAuthorFromRepo == null)
            {
                return NotFound();

            }

            _restApiRepository.DeleteBook(bookForAuthorFromRepo);
            _restApiRepository.Save();

            return NoContent();

        }
Example #2
0
 public void DeleteBook(Book book)
 {
     _restApiRepository.DeleteBook(book);
     _restApiRepository.Save();
 }