예제 #1
0
        public static ISpearConfigBuilder AddSpearConfig(this IConfigurationBuilder builder, IConfiguration configuration = null)
        {
            var config     = configuration ?? builder.Build();
            var acbBuilder = new SpearConfigBuilder(builder, config);

            return(acbBuilder.AddLocal());
        }
예제 #2
0
        public static IServiceCollection AddSpearConfig(this IServiceCollection services, Action <ISpearConfigBuilder> configBuilderAction = null)
        {
            var configBuilder = new SpearConfigBuilder();

            configBuilder.AddLocal();
            configBuilderAction?.Invoke(configBuilder);
            var config = configBuilder.Build();

            services.AddSingleton(config);
            return(services);
        }