Table of Contents

Class ApqCfgOptionsSnapshot<TOptions>

Namespace
Apq.Cfg.DependencyInjection
Assembly
Apq.Cfg.dll

支持每次请求重新绑定的 IOptionsSnapshot 实现

public sealed class ApqCfgOptionsSnapshot<TOptions> : IOptionsSnapshot<TOptions>, IOptions<TOptions> where TOptions : class, new()

Type Parameters

TOptions

配置选项类型

Inheritance
ApqCfgOptionsSnapshot<TOptions>
Implements
IOptions<TOptions>
Inherited Members

Constructors

ApqCfgOptionsSnapshot(ICfgRoot, string)

创建 ApqCfgOptionsSnapshot 实例

public ApqCfgOptionsSnapshot(ICfgRoot cfgRoot, string sectionKey)

Parameters

cfgRoot ICfgRoot

配置根

sectionKey string

配置节键名

Properties

Value

The default configured TOptions instance

public TOptions Value { get; }

Property Value

TOptions

Methods

Get(string?)

Returns a configured TOptions instance with the given name.

public TOptions Get(string? name)

Parameters

name string

The name of the TOptions instance, if null DefaultName is used.

Returns

TOptions

The TOptions instance that matches the given name.