public IActionResult BlockAuthorCreation(Guid id) { if (_libraryRepository.AuthorExists(id)) { return(new StatusCodeResult(StatusCodes.Status409Conflict)); } return(NotFound()); }
public IActionResult GetBooksForAuthor(Guid authorId) { if (!_libraryRepository.AuthorExists(authorId)) { return(NotFound()); } var booksForAuthorFromRepo = _libraryRepository.GetBooksForAuthor(authorId); var booksForAuthor = Mapper.Map <IEnumerable <BookDto> >(booksForAuthorFromRepo); return(Ok(booksForAuthor)); }