diff --git a/DNN Platform/DotNetNuke.Abstractions/Application/IHostSettingsService.cs b/DNN Platform/DotNetNuke.Abstractions/Application/IHostSettingsService.cs index 4c913107719..da50491b91b 100644 --- a/DNN Platform/DotNetNuke.Abstractions/Application/IHostSettingsService.cs +++ b/DNN Platform/DotNetNuke.Abstractions/Application/IHostSettingsService.cs @@ -92,13 +92,13 @@ public interface IHostSettingsService /// Gets all host settings. /// /// host setting. - Dictionary GetSettings(); + IDictionary GetSettings(); /// /// Gets all host settings as dictionary. /// /// host setting's value. - Dictionary GetSettingsDictionary(); + IDictionary GetSettingsDictionary(); /// /// Gets the setting value by the specific key. @@ -140,7 +140,7 @@ public interface IHostSettingsService /// Updates the specified settings. /// /// The settings. - void Update(Dictionary settings); + void Update(IDictionary settings); /// /// Updates the setting for a specified key. diff --git a/DNN Platform/Library/Entities/Controllers/HostController.cs b/DNN Platform/Library/Entities/Controllers/HostController.cs index 8fe9fa52cad..f764ebe98c9 100644 --- a/DNN Platform/Library/Entities/Controllers/HostController.cs +++ b/DNN Platform/Library/Entities/Controllers/HostController.cs @@ -116,7 +116,7 @@ public int GetInteger(string key, int defaultValue) } /// - Dictionary IHostSettingsService.GetSettings() + IDictionary IHostSettingsService.GetSettings() { return CBO.GetCachedObject>( new CacheItemArgs( @@ -128,9 +128,10 @@ Dictionary IHostSettingsService.GetSettings() } /// - public Dictionary GetSettingsDictionary() + IDictionary IHostSettingsService.GetSettingsDictionary() { - return this.GetSettings().ToDictionary(c => c.Key, c => c.Value.Value); + return ((IHostSettingsService)this).GetSettings() + .ToDictionary(c => c.Key, c => c.Value.Value); } /// @@ -162,7 +163,7 @@ public string GetString(string key, string defaultValue) } /// - public void Update(Dictionary settings) + void IHostSettingsService.Update(IDictionary settings) { foreach (KeyValuePair settingKvp in settings) { diff --git a/DNN Platform/Library/Obsolete/HostController.cs b/DNN Platform/Library/Obsolete/HostController.cs index 1c23d977c0f..bb82a6e56d2 100644 --- a/DNN Platform/Library/Obsolete/HostController.cs +++ b/DNN Platform/Library/Obsolete/HostController.cs @@ -32,7 +32,6 @@ public partial class HostController : ComponentBase [Obsolete("Deprecated in 9.7.1. Scheduled for removal in v11.0.0, use DotNetNuke.Abstractions.IHostSettingsService instead.")] public Dictionary GetSettings() => ((IHostSettingsService)this).GetSettings() @@ -40,6 +39,11 @@ public Dictionary GetSettings() => .Select(setting => new KeyValuePair(setting.Key, (ConfigurationSetting)setting.Value)) .ToDictionary(setting => setting.Key, setting => setting.Value); + [Obsolete("Deprecated in 9.7.1. Scheduled for removal in v11.0.0, use DotNetNuke.Abstractions.IHostSettingsService instead.")] + public Dictionary GetSettingsDictionary() => + ((IHostSettingsService)this).GetSettingsDictionary() + .ToDictionary(setting => setting.Key, setting => setting.Value); + /// [Obsolete("Deprecated in 9.7.1. Scheduled for removal in v11.0.0, use DotNetNuke.Abstractions.IHostSettingsService instead.")] public void Update(ConfigurationSetting config) => @@ -49,5 +53,9 @@ public void Update(ConfigurationSetting config) => [Obsolete("Deprecated in 9.7.1. Scheduled for removal in v11.0.0, use DotNetNuke.Abstractions.IHostSettingsService instead.")] public void Update(ConfigurationSetting config, bool clearCache) => ((IHostSettingsService)this).Update(config, clearCache); + + [Obsolete("Deprecated in 9.7.1. Scheduled for removal in v11.0.0, use DotNetNuke.Abstractions.IHostSettingsService instead.")] + public void Update(Dictionary settings) => + ((IHostSettingsService)this).Update(settings); } }