Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save seangwright/1dbb8355676d24089238e83e3519ecfd to your computer and use it in GitHub Desktop.
Save seangwright/1dbb8355676d24089238e83e3519ecfd to your computer and use it in GitHub Desktop.
public class KenticoSettingConfigProvider : IKenticoSettingConfigProvider
{
private readonly ISiteContext siteContext;
public KenticoSettingConfigProvider(ISiteContext siteContext)
{
Guard.Against.Null(siteContext, nameof(siteContext));
this.siteContext = siteContext;
}
public string GetString(string key, bool global = false) =>
global
? SettingsKeyInfoProvider.GetValue(key)
: SettingsKeyInfoProvider.GetValue(key, siteContext.SiteName);
public bool GetBool(string key, bool global = false) =>
global
? SettingsKeyInfoProvider.GetBoolValue(key)
: SettingsKeyInfoProvider.GetBoolValue(key, siteContext.SiteName);
public int GetInt(string key, bool global = false) =>
global
? SettingsKeyInfoProvider.GetIntValue(key)
: SettingsKeyInfoProvider.GetIntValue(key, siteContext.SiteName);
public double GetDouble(string key, bool global = false) =>
global
? SettingsKeyInfoProvider.GetDoubleValue(key)
: SettingsKeyInfoProvider.GetDoubleValue(key, siteContext.SiteName);
public decimal GetDecimal(string key, bool global = false) =>
global
? SettingsKeyInfoProvider.GetDecimalValue(key)
: SettingsKeyInfoProvider.GetDecimalValue(key, siteContext.SiteName);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment