예제 #1
0
        public ActionResult <BookDto> GetBookForAuthor(Guid authorId, Guid bookId)
        {
            if (!_bookLibraryRepository.AuthorExists(authorId))
            {
                return(NotFound());
            }

            var bookForAuthorFromRepo = _bookLibraryRepository.GetBook(authorId, bookId);

            if (bookForAuthorFromRepo == null)
            {
                return(NotFound());
            }

            return(Ok(_mapper.Map <BookDto>(bookForAuthorFromRepo)));
        }