-
-
Notifications
You must be signed in to change notification settings - Fork 266
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
feat: Added support for named options (#478) #534
feat: Added support for named options (#478) #534
Conversation
I added support for named options using the |
Thank you very much! Do you think you can add in some unit tests to confirm that the right named options are impacted and no other named or unnamed options are? Can you update the docs to mention that named options are supported with this method? I'll try to review this quickly. |
I would be happy to update the documentation. I'll update the pull request with some new documentation.
|
Ah perfect -- I didn't see your tests and first and I see now you did update the docs. Thanks again! I will get this out in a release ASAP. |
Note to self -- prioritize for this week. |
@LamarLugli I made some edits and I want to see if you agree. I also updated the docs -- if you agree with my changes I'll go ahead and put out a new release.
services.AddMultiTenant<TenantInfo>()...
.WithPerTenantNamedOptions<MyOptions>(name, (options, tenantInfo) =>
{
// only update options named "someOptionsName"
options.MyOption1 = (int)tenantInfo.Items["someValue"];
options.MyOption2 = (int)tenantInfo.Items["anotherValue"];
}); The difference is the name isn't part of the delegate and the delegate only gets called if the name is correct via the options factory (so no need to check if the name matches). This is how .NET does it and I wanted to match it as closely as possible.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made some changes -- see my comment.
This looks great. Thanks for making this even better. |
🎉 This PR is included in version 6.7.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
No description provided.