public static IApolloConfigurationBuilder AddNamespace(this IApolloConfigurationBuilder builder, string @namespance, IAbpApolloConfiguration configuration) { var apolloBuilder = builder.AddNamespace(@namespance, @namespance); apolloBuilder.ConfigRepositoryFactory .GetConfigRepository(@namespance) .AddChangeListener(new RepositoryChangeListener(configuration)); return(apolloBuilder); }
private static IConfigurationBuilder BindNameSpace(this IApolloConfigurationBuilder builder, string[] namespaces) { if (namespaces.IsNull()) { return(builder); } foreach (var @namespace in namespaces) { builder.AddNamespace(@namespace); } return(builder); }
/// <summary>添加其他namespace</summary> public static IApolloConfigurationBuilder AddNamespace(this IApolloConfigurationBuilder builder, string @namespace, ConfigFileFormat format = ConfigFileFormat.Properties) => builder.AddNamespace(@namespace, null, format);
/// <summary>添加默认namespace: application,等价于AddNamespace(ConfigConsts.NamespaceApplication)</summary> public static IApolloConfigurationBuilder AddDefault(this IApolloConfigurationBuilder builder, ConfigFileFormat format = ConfigFileFormat.Properties) => builder.AddNamespace(ConfigConsts.NamespaceApplication, null, format);
/// <summary>添加其他namespace</summary> public static IApolloConfigurationBuilder AddNamespace(this IApolloConfigurationBuilder builder, string @namespace) => builder.AddNamespace(@namespace, null);
/// <summary>添加默认namespace: application</summary> public static IApolloConfigurationBuilder AddDefault(this IApolloConfigurationBuilder builder) => builder.AddNamespace(ConfigConsts.NamespaceApplication, null);