Initialize "UseSqlServerStorage" outside Startup and global.asax

Hi!

I need to configure Hangfire after I receive a webapi request: that request’s payload carries the information to log into the SQLServer, so I cannot use Global.asax nor Startup class (they were fired long time ago!).

This implies that I cannot use “app.UseHangfireDashboard()” nor “app.UseHangfireServer()”, since it goes into the Configuration method on Startup class.

How can I achieve this “late” initialization? I’m currently calling Configuration.UseSqlServerStorage in my webapi controller

Thanks in advance!