-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Cleanup ISmsService #15142
Cleanup ISmsService #15142
Conversation
While you working on SMS again, I'm still worrying why you didn't use |
Because with keyed-services, you can't do this OrchardCore/src/OrchardCore.Modules/OrchardCore.Sms/Drivers/SmsSettingsDisplayDriver.cs Lines 52 to 53 in e759e2c
You don't have access to the keys. |
That's why we need the PR #15100. IMHO let us:
|
@hishamco This approach has an advantage over keyed service where we don't need to add extra services to the DI container since these provider are resolved without the being registered into the container. Also, it has the IsEnable flag for each service where one can enable/disable provider. Also, I don't like that we have to implement a workaround for keyed-services in OC. In this PR, I am just doing some cleanup to simplify the service |
There's no extra service, what you are done is keeping the provider name in the options itself, which is the first time I saw in the Orchard Core code-base since the beginning
This is another thing, we already did something similar in Localization while not supporting ASP.NET Core, don't forget we can't run ASP.NET Core team in something we need |
private readonly ISmsProviderResolver _smsProviderResolver; | ||
private ISmsProvider _provider; |
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.
private readonly ISmsProviderResolver _smsProviderResolver; | |
private ISmsProvider _provider; | |
private ISmsProvider _provider; | |
private readonly ISmsProviderResolver _smsProviderResolver; |
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 usually leave the static variables top, then readonly then the writable privates. It's done that way everywhere
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.
You're right
^ This is the 1st commit message: Add GetCulture() extension method ^ This is the commit message #2: Cleanup ISmsService (#15142) ^ This is the commit message #3: Fix TheAdminTheme layout margin and padding (#15143) ^ This is the commit message #4: Fix SectionDisplayDriver prefix (#15123) ^ This is the commit message #5: Prefill template name when creating a template. (#15145) ^ This is the commit message #6: Set the User Localization feature priority ^ This is the commit message #7: Fix issue with default culture not selected When currentUserCulture is null or supportedCulture doesn't contain currentUserCulture. ^ This is the commit message #8: Update the height of the admin content (#15153) ^ This is the commit message #9: Eliminate the anti-discovery pattern in Elasticsearch (#15134) ^ This is the commit message #10: Renaming and cleaning up search services (#15156) ^ This is the commit message #11: mkdocs-material 9.5.5
…themes (#11243) Cleanup ISmsService (#15142) Fix TheAdminTheme layout margin and padding (#15143) Fix SectionDisplayDriver prefix (#15123) Prefill template name when creating a template. (#15145) Set the User Localization feature priority Fix issue with default culture not selected When currentUserCulture is null or supportedCulture doesn't contain currentUserCulture. Update the height of the admin content (#15153) Eliminate the anti-discovery pattern in Elasticsearch (#15134) Renaming and cleaning up search services (#15156) mkdocs-material 9.5.5 User Timezone settings refresh Originally from Hisham revert manifest
No description provided.