IConfigurationSection 接口

定义

表示应用程序配置值的一节。Represents a section of application configuration values.

public interface class IConfigurationSection : Microsoft::Extensions::Configuration::IConfiguration
public interface IConfigurationSection : Microsoft.Extensions.Configuration.IConfiguration
type IConfigurationSection = interface
    interface IConfiguration
Public Interface IConfigurationSection
Implements IConfiguration
派生
实现

属性

Item[String]

获取或设置配置值。Gets or sets a configuration value.

(继承自 IConfiguration)
Key

获取此节在其父级中占用的键。Gets the key this section occupies in its parent.

Path

IConfiguration 获取此节的完整路径。Gets the full path to this section within the IConfiguration.

Value

获取或设置节值。Gets or sets the section value.

方法

GetChildren()

获取直接后代配置子节。Gets the immediate descendant configuration sub-sections.

(继承自 IConfiguration)
GetReloadToken()

返回一个可用于在重载此配置时进行观察的 IChangeTokenReturns a IChangeToken that can be used to observe when this configuration is reloaded.

(继承自 IConfiguration)
GetSection(String)

获取具有指定键的配置子节。Gets a configuration sub-section with the specified key.

(继承自 IConfiguration)

扩展方法

Bind(IConfiguration, Object)

尝试通过按递归方式根据配置键匹配属性名称,将给定的对象实例绑定到配置值。Attempts to bind the given object instance to configuration values by matching property names against configuration keys recursively.

Bind(IConfiguration, Object, Action<BinderOptions>)

尝试通过按递归方式根据配置键匹配属性名称,将给定的对象实例绑定到配置值。Attempts to bind the given object instance to configuration values by matching property names against configuration keys recursively.

Bind(IConfiguration, String, Object)

尝试通过按递归方式根据配置键匹配属性名称,将给定的对象实例绑定到该键指定的配置节。Attempts to bind the given object instance to the configuration section specified by the key by matching property names against configuration keys recursively.

Get(IConfiguration, Type)

尝试将配置实例绑定到类型为 T 的新实例。如果此配置节包含一个值,则将使用该值。Attempts to bind the configuration instance to a new instance of type T. If this configuration section has a value, that will be used. 否则,通过按递归方式根据配置键匹配属性名称来进行绑定。Otherwise binding by matching property names against configuration keys recursively.

Get(IConfiguration, Type, Action<BinderOptions>)

尝试将配置实例绑定到类型为 T 的新实例。如果此配置节包含一个值,则将使用该值。Attempts to bind the configuration instance to a new instance of type T. If this configuration section has a value, that will be used. 否则,通过按递归方式根据配置键匹配属性名称来进行绑定。Otherwise binding by matching property names against configuration keys recursively.

Get<T>(IConfiguration)

尝试将配置实例绑定到类型为 T 的新实例。如果此配置节包含一个值,则将使用该值。Attempts to bind the configuration instance to a new instance of type T. If this configuration section has a value, that will be used. 否则,通过按递归方式根据配置键匹配属性名称来进行绑定。Otherwise binding by matching property names against configuration keys recursively.

Get<T>(IConfiguration, Action<BinderOptions>)

尝试将配置实例绑定到类型为 T 的新实例。如果此配置节包含一个值,则将使用该值。Attempts to bind the configuration instance to a new instance of type T. If this configuration section has a value, that will be used. 否则,通过按递归方式根据配置键匹配属性名称来进行绑定。Otherwise binding by matching property names against configuration keys recursively.

GetValue(IConfiguration, Type, String)

提取具有指定键的值,并将其转换为指定的类型。Extracts the value with the specified key and converts it to the specified type.

GetValue(IConfiguration, Type, String, Object)

提取具有指定键的值,并将其转换为指定的类型。Extracts the value with the specified key and converts it to the specified type.

GetValue<T>(IConfiguration, String)

提取具有指定键的值,并将其转换为 T 类型。Extracts the value with the specified key and converts it to type T.

GetValue<T>(IConfiguration, String, T)

提取具有指定键的值,并将其转换为 T 类型。Extracts the value with the specified key and converts it to type T.

AsEnumerable(IConfiguration)

获取 IConfiguration 中的键值对的枚举Get the enumeration of key value pairs within the IConfiguration

AsEnumerable(IConfiguration, Boolean)

获取 IConfiguration 中的键值对的枚举Get the enumeration of key value pairs within the IConfiguration

Exists(IConfigurationSection)

确定该部分是否具有 Value 或子级。Determines whether the section has a Value or has children.

GetConnectionString(IConfiguration, String)

GetSection("ConnectionStrings")[name] 的简写形式。Shorthand for GetSection("ConnectionStrings")[name].

适用于