Add IPortalSettingsManager for Abstractions Project
Related to #3985
Summary
Adds a new interface to Dependency Injection DotNetNuke.Abstractions.Portals.IPortalSettingsManager which is used for retrieving the current portal settings. The API structure in this PR has been simplified to use modern techniques in .NET such as generics and indexers. It still maintains the main functionality
- Get
- Update
- Update Encrypted
- Delete
Usage
This PR takes a few different interfaces and combines their implementations to work together. It will be consumed via dependency injection using the IPortalSettingsManager.
var portalSettingsManager = Globals.DependencyProvider.GetRequiredService<IPortalSettingsManager>();
bool mySetting = portalSettingsManager
.GetPortalSettings(portalId, cultureCode)
.Get<bool>("My true/false portal setting");
The example above uses the service locator pattern, it is always recommended to use constructor injection where possible.
Missing Items
Currently this PR is missing a few parts of the implementation. I submitted it early to get feedback prior on the general direction. Below is a list of missing features that I plan to implement after the initial review.
-
IConfigurationSettingprovides a Key-Value-Pair object which is used throughout DNN - Get & Update dictionary. The old implementation allowed the user to get the entire dictionary or update the entire dictionary at once. Currently those APIs are not implemented
Required to merge
This PR was submitted prior to working on Unit Tests or validating the build works. I am doing this to get early feedback on architectural decisions being made with the changes proposed here.
| Task | Status |
|---|---|
| Unit Tests | ❌ Not Started |
| Test Installer | ❌ Not Started |
Since #4087 and #4159 have been merged this PR can be updated to reflect the latest and greatest code changes. Here is my list of things to do
- Update eventlogger to use
IEventLoggervia DI - Update serialization to use DI
- Update PR based on review feedback
I am not 100% sure, but I think I am going to flatten the structure here as the PR is as written is kind of complicated and unnecessary
We have detected this issue has not had any activity during the last 90 days. That could mean this issue is no longer relevant and/or nobody has found the necessary time to address the issue. We are trying to keep the list of open issues limited to those issues that are relevant to the majority and to close the ones that have become 'stale' (inactive). If no further activity is detected within the next 14 days, the issue will be closed automatically. If new comments are are posted and/or a solution (pull request) is submitted for review that references this issue, the issue will not be closed. Closed issues can be reopened at any time in the future. Please remember those participating in this open source project are volunteers trying to help others and creating a better DNN Platform for all. Thank you for your continued involvement and contributions!
Thanks for this contribution, given the time and other shifts these proposed changes have been noted, but a new pull request will be created if necessary to merge elements into the new 10.0 release plan.