public static ISpearConfigBuilder AddSpearConfig(this IConfigurationBuilder builder, IConfiguration configuration = null) { var config = configuration ?? builder.Build(); var acbBuilder = new SpearConfigBuilder(builder, config); return(acbBuilder.AddLocal()); }
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); }