public IActionResult GetAllBooksByAuthor(string author) { try { var allBooks = _bookLibraryRepository.GetAllBooksByAuthor(author); var allBooksResults = Mapper.Map <IEnumerable <BookWithAuthorDto> >(allBooks); return(Ok(allBooksResults)); } catch (Exception ex) { _logger.LogInformation($"Exeption while getting all books by author", ex); return(StatusCode(500, "A problem happend while handeling your request.")); } }