Interface IHostSettingsService
The IHostSettingsService provides business layer of the HostSettings Entity.
Namespace: DotNetNuke.Abstractions.Application
Assembly: DotNetNuke.Abstractions.dll
Syntax
public interface IHostSettingsService
Examples
public class MySampleClass
{
IHostSettingsService service;
public MySampleClass(IHostSettingsService service)
{
this.service = service;
}
public bool CheckUpgrade { get => this.service.GetBoolean("CheckUpgrade", true);
}
Methods
| Improve this Doc View SourceGetBoolean(String, Boolean)
Gets the setting value by the specific key.
Declaration
bool GetBoolean(string key, bool defaultValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
System.Boolean | defaultValue | this value will be return if setting's value is empty. |
Returns
Type | Description |
---|---|
System.Boolean | host setting's value. |
GetBoolean(String)
Gets the setting value by the specific key.
Declaration
bool GetBoolean(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
Returns
Type | Description |
---|---|
System.Boolean | host setting's value. |
GetDouble(String, Double)
Gets the setting value by the specific key.
Declaration
double GetDouble(string key, double defaultValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
System.Double | defaultValue | this value will be return if setting's value is empty. |
Returns
Type | Description |
---|---|
System.Double | host setting's value. |
GetDouble(String)
Gets the setting value by the specific key.
Declaration
double GetDouble(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
Returns
Type | Description |
---|---|
System.Double | host setting's value. |
GetEncryptedString(String, String)
takes in a text value, decrypts it with a FIPS compliant algorithm and returns the value.
Declaration
string GetEncryptedString(string key, string passPhrase)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | the host setting to read. |
System.String | passPhrase | the pass phrase used for encryption/decryption. |
Returns
Type | Description |
---|---|
System.String | The setting value as a |
GetInteger(String, Int32)
Gets the setting value by the specific key.
Declaration
int GetInteger(string key, int defaultValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
System.Int32 | defaultValue | this value will be return if setting's value is empty. |
Returns
Type | Description |
---|---|
System.Int32 | host setting's value. |
GetInteger(String)
Gets the setting value by the specific key.
Declaration
int GetInteger(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
Returns
Type | Description |
---|---|
System.Int32 | host setting's value. |
GetSettings()
Gets all host settings.
Declaration
IDictionary<string, IConfigurationSetting> GetSettings()
Returns
Type | Description |
---|---|
IDictionary<System.String, IConfigurationSetting> | host setting. |
GetSettingsDictionary()
Gets all host settings as dictionary.
Declaration
IDictionary<string, string> GetSettingsDictionary()
Returns
Type | Description |
---|---|
IDictionary<System.String, System.String> | host setting's value. |
GetString(String, String)
Gets the setting value by the specific key.
Declaration
string GetString(string key, string defaultValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
System.String | defaultValue | this value will be return if setting's value is empty. |
Returns
Type | Description |
---|---|
System.String | host setting's value. |
GetString(String)
Gets the setting value by the specific key.
Declaration
string GetString(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
Returns
Type | Description |
---|---|
System.String | host setting's value. |
IncrementCrmVersion(Boolean)
Increments the Client Resource Manager (CRM) version to bust local cache.
Declaration
void IncrementCrmVersion(bool includeOverridingPortals)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | includeOverridingPortals | If true also forces a CRM version increment on portals that have non-default settings for CRM. |
Update(IConfigurationSetting, Boolean)
Updates the specified config.
Declaration
void Update(IConfigurationSetting config, bool clearCache)
Parameters
Type | Name | Description |
---|---|---|
IConfigurationSetting | config | The config. |
System.Boolean | clearCache | if set to |
Update(IConfigurationSetting)
Updates the specified config.
Declaration
void Update(IConfigurationSetting config)
Parameters
Type | Name | Description |
---|---|---|
IConfigurationSetting | config | The config. |
Update(IDictionary<String, String>)
Updates the specified settings.
Declaration
void Update(IDictionary<string, string> settings)
Parameters
Type | Name | Description |
---|---|---|
IDictionary<System.String, System.String> | settings | The settings. |
Update(String, String, Boolean)
Updates the specified key.
Declaration
void Update(string key, string value, bool clearCache)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
System.String | value | The value. |
System.Boolean | clearCache | if set to |
Update(String, String)
Updates the setting for a specified key.
Declaration
void Update(string key, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
System.String | value | The value. |
UpdateEncryptedString(String, String, String)
Takes in a
Declaration
void UpdateEncryptedString(string key, string value, string passPhrase)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | host settings key. |
System.String | value | host settings value. |
System.String | passPhrase | pass phrase to allow encryption/decryption. |