public static class SettingsUtil | |
{ | |
// 1. Instead of Factory.GetConfigNode(customConfigNode) | |
public XmlNode GetConfigNode(string customConfigNode) | |
{ | |
return ConfigReader.GetConfiguration().SelectSingleNode($"sitecore/{customConfigNode}"); | |
} | |
// 2. Instead of Settings.GetSetting(name) | |
public string GetSetting(string name) | |
{ | |
var node = ConfigReader.GetConfiguration().SelectSingleNode($"sitecore/settings/setting[@name='{name}']"); | |
if (node == null) | |
{ | |
return null; | |
} | |
return node.Attributes["value"].Value; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment