Example #1
0
        public bool DeleteBook(int authorId, int id)
        {
            ValidateAuthor(authorId);
            var bookToDelete = authorsRepository.GetBooks().SingleOrDefault(b => b.Id == id);

            if (bookToDelete == null)
            {
                throw new NotFoundException("invalid book to delete");
            }
            return(authorsRepository.DeleteBook(id));
        }