Question one:
The swagger page operation always displays a 500 error , and then look at the specific cause of the error in the black window
and find that it is
An exception was thrown while activating BookController->BookService->BookRepository
Then the problem lies in the following aspects:
This exception indicates that some problems occurred when instantiating the BookController object. More specifically, it throws an exception when instantiating the BookService object and further instantiating the BookRepository object .
To fix this, you need to check the following:
Dependency Injection Configuration: Make sure you have properly configured your dependency injection container to register BookRepository as a dependency of BookService. Make sure that dependency injection for BookRepository is properly set up in the container's configuration.
Implementation of BookRepository: Make sure the implementation of BookRepository is correct and available. Check for any errors or unhandled exceptions to ensure that the implementation can be instantiated and used correctly.
Constructor dependencies: Check the parameters in the BookService constructor and make sure their dependencies are injected correctly. If BookRepository requires other dependencies, make sure they are properly injected as well.
Exception Log: View exception details, stack traces, and any associated error messages. This will provide more context to help you better locate and resolve issues. </