Apq.Cfg.ICfgRoot.md 4.4 KB

Apq.Cfg

Apq.Cfg

ICfgRoot Interface

配置根接口,提供统一的配置访问和管理功能

public interface ICfgRoot : System.IDisposable, System.IAsyncDisposable

Derived
MergedCfgRoot

Implements System.IDisposable, System.IAsyncDisposable

Properties
ConfigChanges 获取配置变更的可观察序列
Methods
Exists(string) 检查配置键是否存在
Get(string) 获取配置值
Get<T>(string) 获取配置值并转换为指定类型
GetChildKeys() 获取所有顶级配置键
GetMany(IEnumerable<string>) 批量获取多个配置值,减少锁竞争
GetMany(IEnumerable<string>, Action<string,string>) 高性能批量获取:通过回调方式返回结果,零堆分配
GetMany<T>(IEnumerable<string>) 批量获取多个配置值并转换为指定类型
GetMany<T>(IEnumerable<string>, Action<string,T>) 高性能批量获取:通过回调方式返回结果并转换类型,零堆分配
GetSection(string) 获取配置节
Remove(string, Nullable<int>) 移除配置键
SaveAsync(Nullable<int>, CancellationToken) 保存配置更改到持久化存储
Set(string, string, Nullable<int>) 设置配置值
SetMany(IEnumerable<KeyValuePair<string,string>>, Nullable<int>) 批量设置多个配置值,减少锁竞争
ToMicrosoftConfiguration() 转换为 Microsoft Configuration(静态快照)
ToMicrosoftConfiguration(DynamicReloadOptions) 转换为支持动态重载的 Microsoft Configuration