Example #1
0
        public IActionResult GetAllBooksByTitle(string title)
        {
            try
            {
                var allBooks = _bookLibraryRepository.GetAllBooksByTitle(title);

                var allBooksResults = Mapper.Map <IEnumerable <BookWithAuthorDto> >(allBooks);

                return(Ok(allBooksResults));
            }
            catch (Exception ex)
            {
                _logger.LogInformation($"Exeption while getting all books by title", ex);
                return(StatusCode(500, "A problem happend while handeling your request."));
            }
        }