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.32k stars 267 forks source link

MultiTenantContext has internal properties #219

Closed UmairB closed 4 years ago

UmairB commented 4 years ago

Why was a decision made to make MultiTenantContext with internal properties? Finbuckle has been very good for us in asp.net core scenario but when we tried to implement our infrastructure using finbuckle in say, azure functions, we ran into the problem of not being able to provide a mechanism for creating our own MultiTenantContext.

Maybe make MultiTenantContext an abstract base class and allow different implementions to provide their own way of creating this? Or abstract the code that creates the multitenant context out of the asp.net core middleware and put it into a service in core. Which will allow anyone to create a multitenant context from anywhere.

AndrewTriesToCode commented 4 years ago

hi @UmairB

There is no strong reason other than my personal preference for strong encapsulation at the time. I definitely agree with you and will plan to address this in the next release.

Thanks!

AndrewTriesToCode commented 4 years ago

I'll add to this that I also plan to remove the dependency on HtpContext storing the MultiTtenantContext so that things work better in scenarios like yours or also non web hosted .NET Core stuff.