public ActionResult<IEquatable<BookDto>> GetBooksForAuthor(Guid authorId) { if (!_restApiRepository.AuthorExists(authorId)) { return NotFound(); } var booksForAuhthorFromRepo = _restApiRepository.GetBooks(authorId); return Ok(_mapper.Map<IEnumerable<BookDto>>(booksForAuhthorFromRepo)); }
public IEnumerable <Book> GetBooks(Guid authorId) { if (authorId == Guid.Empty) { throw new ArgumentNullException(nameof(authorId)); } return(_restApiRepository.GetBooks(authorId)); }