示例#1
0
        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);
        }
示例#2
0
        private static IConfigurationBuilder BindNameSpace(this IApolloConfigurationBuilder builder, string[] namespaces)
        {
            if (namespaces.IsNull())
            {
                return(builder);
            }

            foreach (var @namespace in namespaces)
            {
                builder.AddNamespace(@namespace);
            }

            return(builder);
        }
示例#3
0
 /// <summary>添加其他namespace</summary>
 public static IApolloConfigurationBuilder AddNamespace(this IApolloConfigurationBuilder builder, string @namespace, ConfigFileFormat format = ConfigFileFormat.Properties) =>
 builder.AddNamespace(@namespace, null, format);
示例#4
0
 /// <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);