Inject DbContext when database name is only know when the controller action is called
问题 I have a WebAPI/EF Core back-end application with several possible client databases to connect to (each of the same schema, but only one at a time). Knowledge of which database to connect to will not be known until a WebAPI controller is accessed. By that time, it will be too late to add the DBContext as an injectable object using the call to services.AddDbContext<>() in the ConfigureServices() method of the starup.cs file. Since each instance of DbContext is isolated per request, is there