0
MellowoodMedical created
Hi Support Team, I have one concerning about External Hangfire background service.
I do able inject HostDbContext in HangfireAppService.
But how can I inject IRepositoryTenantTable base on TenantId, or perhaps TenantConnectionString ?
And how can I inject ICustomRepository base on TenantId, or perhaps TenantConnectionString ?
Implement of ICustomRepository has some function/methods that I would like to re-use instead of create new TenantDbContext
Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)
1 Answer(s)
-
0
Hi @MellowoodMedical
You can switch between Host and Tenant context, see https://aspnetboilerplate.com/Pages/Documents/Multi-Tenancy#switching-between-host-and-tenants. If you swithc the Tenant context, the repositories will access the TenantDbContext.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)