IConfiguration Interface

Definition

表示一組索引鍵/值應用程式組態屬性。Represents a set of key/value application configuration properties.

public interface class IConfiguration
public interface IConfiguration
type IConfiguration = interface
Public Interface IConfiguration
Derived

Properties

Item[String]

取得或設定組態值。Gets or sets a configuration value.

Methods

GetChildren()

取得直屬子系組態子區段。Gets the immediate descendant configuration sub-sections.

GetReloadToken()

傳回可用於在重新載入此組態時觀察的 IChangeTokenReturns a IChangeToken that can be used to observe when this configuration is reloaded.

GetSection(String)

取得具有指定索引鍵的組態子區段。Gets a configuration sub-section with the specified key.

Extension Methods

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

GetConnectionString(IConfiguration, String)

GetSection("ConnectionStrings")[name] 的速記。Shorthand for GetSection("ConnectionStrings")[name].

Applies to