I set connection string in startup.cs but I need to change dbContext and hangfire connectionString according to httpContext request. I have some idea about dbContext but I don't have any idea about hangfire connString. How can I do this? Thanks.
My code in startup.cs like this:
var connStr = Configuration.GetConnectionString("DefaultConnection");
services.AddDbContext<ExampleContext>(options => options.UseSqlServer(connStr));
services.AddHangfire(x => x.UseSqlServerStorage(connStr));
services.AddHangfireServer();
I want to change "DefaultConnection" according to "HttpContext.Request.Host.Host".