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