Last active
April 27, 2019 23:24
-
-
Save seangwright/1dbb8355676d24089238e83e3519ecfd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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