Finbuckle / Finbuckle.MultiTenant

Finbuckle.MultiTenant is an open-source multitenancy middleware library for .NET. It enables tenant resolution, per-tenant app behavior, and per-tenant data isolation.
https://www.finbuckle.com/multitenant
Apache License 2.0
1.26k stars 261 forks source link

Support for setting TenantInfo without using a store #678

Open priyankasyal opened 12 months ago

priyankasyal commented 12 months ago

Hi, I have a use-case where I have different use-cases for injecting tenant information as follows:

Is there a way to solve the second issue? I am pretty new to using finbuckle so I might be missing something here. Thanks Priyanka

turkysha commented 6 months ago

You can write your own middleware and call TrySetTenantInfo() function attachted to HttpConntext to manually set TenantInfo or you could manually attach TenantInfo to your DbContext if you have reference to TenantInfo in your DbContext.

kesavan-m-19 commented 3 weeks ago

Hi turkysha,

I am using below modules in FinBuckle

  1. Strategy - Delegate Strategy - To get tenant identifier from the request URL
  2. Store - Http Remote Store - To get tenant details via API of an another service

While implementation I have noticed that for every incoming requests API call was initiated to get tenant details. But I am expecting as, once tenant details was retrieved it needs to be reused for upcoming requests, instead of initiating another API call for getting same tenant details.

Can you confirm,

Please share your suggestion on this requirement. Thanks in advance.

AndrewTriesToCode commented 3 weeks ago

@kesavan-m-19 and @priyankasyal

Check out PR #805 if contains an echo store which is kind of a dummy store that returns a tenant info with the identifier set and no db or api calls.