#### [Apq\.Cfg](index.md 'index') ### [Apq\.Cfg](Apq.Cfg.md 'Apq\.Cfg') ## ServiceCollectionExtensions Class IServiceCollection 扩展方法 ```csharp public static class ServiceCollectionExtensions ``` Inheritance [System\.Object](https://learn.microsoft.com/en-us/dotnet/api/system.object 'System\.Object') 🡒 ServiceCollectionExtensions | Methods | | | :--- | :--- | | [AddApqCfg\(this IServiceCollection, Action<CfgBuilder,IServiceProvider>\)](Apq.Cfg.ServiceCollectionExtensions.AddApqCfg.md#Apq.Cfg.ServiceCollectionExtensions.AddApqCfg(thisMicrosoft.Extensions.DependencyInjection.IServiceCollection,System.Action_Apq.Cfg.CfgBuilder,System.IServiceProvider_) 'Apq\.Cfg\.ServiceCollectionExtensions\.AddApqCfg\(this Microsoft\.Extensions\.DependencyInjection\.IServiceCollection, System\.Action\\)') | 添加 Apq\.Cfg 配置服务(支持访问 IServiceProvider) | | [AddApqCfg\(this IServiceCollection, Action<CfgBuilder>\)](Apq.Cfg.ServiceCollectionExtensions.AddApqCfg.md#Apq.Cfg.ServiceCollectionExtensions.AddApqCfg(thisMicrosoft.Extensions.DependencyInjection.IServiceCollection,System.Action_Apq.Cfg.CfgBuilder_) 'Apq\.Cfg\.ServiceCollectionExtensions\.AddApqCfg\(this Microsoft\.Extensions\.DependencyInjection\.IServiceCollection, System\.Action\\)') | 添加 Apq\.Cfg 配置服务 | | [AddApqCfg\(this IServiceCollection, Func<IServiceProvider,ICfgRoot>\)](Apq.Cfg.ServiceCollectionExtensions.AddApqCfg.md#Apq.Cfg.ServiceCollectionExtensions.AddApqCfg(thisMicrosoft.Extensions.DependencyInjection.IServiceCollection,System.Func_System.IServiceProvider,Apq.Cfg.ICfgRoot_) 'Apq\.Cfg\.ServiceCollectionExtensions\.AddApqCfg\(this Microsoft\.Extensions\.DependencyInjection\.IServiceCollection, System\.Func\\)') | 添加 Apq\.Cfg 配置服务(使用工厂方法) | | [AddApqCfg<TOptions>\(this IServiceCollection, Action<CfgBuilder>, string\)](Apq.Cfg.ServiceCollectionExtensions.AddApqCfg.md#Apq.Cfg.ServiceCollectionExtensions.AddApqCfg_TOptions_(thisMicrosoft.Extensions.DependencyInjection.IServiceCollection,System.Action_Apq.Cfg.CfgBuilder_,string) 'Apq\.Cfg\.ServiceCollectionExtensions\.AddApqCfg\\(this Microsoft\.Extensions\.DependencyInjection\.IServiceCollection, System\.Action\, string\)') | 添加 Apq\.Cfg 配置服务并绑定强类型配置 | | [ConfigureApqCfg<TOptions>\(this IServiceCollection, string\)](Apq.Cfg.ServiceCollectionExtensions.ConfigureApqCfg.md#Apq.Cfg.ServiceCollectionExtensions.ConfigureApqCfg_TOptions_(thisMicrosoft.Extensions.DependencyInjection.IServiceCollection,string) 'Apq\.Cfg\.ServiceCollectionExtensions\.ConfigureApqCfg\\(this Microsoft\.Extensions\.DependencyInjection\.IServiceCollection, string\)') | 配置强类型选项(从 ICfgRoot 绑定),支持嵌套对象和集合 | | [ConfigureApqCfg<TOptions>\(this IServiceCollection, string, Action<TOptions>\)](Apq.Cfg.ServiceCollectionExtensions.ConfigureApqCfg.md#Apq.Cfg.ServiceCollectionExtensions.ConfigureApqCfg_TOptions_(thisMicrosoft.Extensions.DependencyInjection.IServiceCollection,string,System.Action_TOptions_) 'Apq\.Cfg\.ServiceCollectionExtensions\.ConfigureApqCfg\\(this Microsoft\.Extensions\.DependencyInjection\.IServiceCollection, string, System\.Action\\)') | 配置强类型选项并启用配置变更监听 |