-
-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WithPerTenantOptions overload allowing dependency injection? #478
Comments
Hi, I think I see what you mean -- you want to access DI from within the lambda inside I will have to add this but I have a workaround that will be available before .NET 6 comes out. |
One thing you could try for now is to implement |
The interface is not public, so I cannot implement it: Finbuckle.MultiTenant/src/Finbuckle.MultiTenant/Options/ITenantConfigureOptions.cs Line 6 in e0c88b0
|
OT: Are you interested in a PR adding support for a |
You are right it is not public! I will change it to public for the next release which will be for .Net 6 in November at the latest. Regarding support for names options- yes this is on my todo list and probably will come shortly after the .NET 6 release. If you want to take a stab at it and submit a PR please do so. |
I just released 6.4.2 on nuget.org which makes this a public interface. Thanks for your patience. |
* Added support for named options (#478) * Updated documentation for named options. * Added extra comment to documentation. * chore: refactor to match .NET named options patterns * chore: mark unnamed tenant options types obsolete * chore: updated docs * chore: minor docs update Co-authored-by: Andrew White <andrew@finbuckle.com>
Named options added to the latest release. Cheers. |
In order to use dependency injected services while configuring services, you'd normally inherit from
IConfigureNamedOptions
orIConfigureOptions
and register a singleton like this:Inside
MyConfiguration
I can have dependencies injected:With the current
WithPerTenantOptions<CookieAuthenticationOptions>
I cannot achieve the same. The data protector is only instantiate later on in the pipeline and I cannot grab a reference to it inConfigureServices
.The text was updated successfully, but these errors were encountered: