public IActionResult GetSingleBook(int authorid, int id) { if (!_bookLibraryRepository.AuthorExists(authorid)) { return(NotFound()); } var book = _bookLibraryRepository.GetBookForAuthor(authorid, id); if (book == null) { return(NotFound()); } var booktResult = Mapper.Map <BookDto>(book); return(Ok(booktResult)); }