Exemplo n.º 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());
        }
Exemplo n.º 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);
        }