示例#1
0
 public IAppConfigurationSection GetSection(string key)
 {
     return(new ConnectionStringsAppConfigurationSection(
                configurationManager,
                AppConfigurationPath.Combine(Path, key)
                ));
 }
        internal static IEnumerable <IAppConfigurationSection> GetChildren(this IAppConfiguration configuration, string path)
        {
            if (configuration == null)
            {
                return(Enumerable.Empty <IAppConfigurationSection>());
            }

            if (!(configuration is IAppConfigurationRoot root))
            {
                return(configuration.GetChildren(path));
            }

            IEnumerable <string> childKeys = GetChildKeys(root, path);

            return(childKeys.Select(key => root.GetSection(path == null
                ? key
                : AppConfigurationPath.Combine(path, key))
                                    ));
        }
 public IAppConfigurationSection GetSection(string key)
 {
     return(root.GetSection(AppConfigurationPath.Combine(Path, key)));
 }
 public string this[string key] => root[AppConfigurationPath.Combine(Path, key)];