How can I pass in a connection string from the controller during runtime in an an MVC Core app? I want to let the user choose a database to connect to.
public void ConfigureServices(IServiceCollection services)
{
var connection = @"Pass from controller?";
services.AddDbContext<DataLoaderConfigContext>(options => options.UseSqlServer(connection));
services.AddMvc();
}