Beispiel #1
0
 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));
 }
Beispiel #2
0
        public bool AuthorExists(Guid authorId)
        {
            if (authorId == Guid.Empty)
            {
                throw new ArgumentNullException(nameof(authorId));
            }

            return(_restApiRepository.AuthorExists(authorId));
        }