We are building a multi tenant infrastructure with single application and a separate database per tenant.
We have one scheduled hangfire job to run daily and this job queues several jobs - one per tenant.
Now these tenant jobs should all connect to different databases. At the moment DI instantiates all services required for this job with default Dbcontext. Can someone throw some pointers on how this could be achieved?
We are using .net core DI and API requests are served with data from different databases based on the httpcontext. The problem is that the job doesn’t have any context and not sure how to assign separate contexts to the jobs.