Finbuckle.MultiTenant icon indicating copy to clipboard operation
Finbuckle.MultiTenant copied to clipboard

Using in a Worker Service

Open terencevs opened this issue 2 years ago • 1 comments

Thank you for a great package!

Is there any examples of how to setup to use the default TenantInfo implementation in a worker service? Using EntityFramework.

Program.CS image

I am using Quartz for job schduling:

image

Tenant Details is null when we get into the job, am I missing something simple?

terencevs avatar Oct 12 '23 11:10 terencevs

Hi, sorry for the slow reply. Use DI to get an instance of TenantResolver which has a "ResolveAasync method which takes some sort of context (the middleware uses this and passes HttpContext for the context).

You can pass any contact and your strategy will see it and interpret as you need to. Most built in strategies are for the web but you can define your own or use delegate strategy which just takes the context as an Object a you can cast it as needed. Hope this help. I need to do a write up on this scenario.

AndrewTriesToCode avatar Oct 24 '23 02:10 AndrewTriesToCode