IConfigurationManager 介面

定義

表示可變動的組態物件。

public interface class IConfigurationManager : Microsoft::Extensions::Configuration::IConfiguration, Microsoft::Extensions::Configuration::IConfigurationBuilder
public interface IConfigurationManager : Microsoft.Extensions.Configuration.IConfiguration, Microsoft.Extensions.Configuration.IConfigurationBuilder
type IConfigurationManager = interface
    interface IConfiguration
    interface IConfigurationBuilder
Public Interface IConfigurationManager
Implements IConfiguration, IConfigurationBuilder
衍生
實作

備註

它既是 IConfigurationBuilder,也是 IConfiguration。 新增來源時,它會更新其目前組態檢視。

屬性

Item[String]

取得或設定組態值。

(繼承來源 IConfiguration)
Properties

取得索引鍵/值集合,可用來在 IConfigurationBuilder 與已註冊 IConfigurationSource之間共享數據。

(繼承來源 IConfigurationBuilder)
Sources

取得用來取得組態值的來源。

(繼承來源 IConfigurationBuilder)

方法

Add(IConfigurationSource)

新增組態來源。

(繼承來源 IConfigurationBuilder)
Build()

使用在 Sources中註冊之來源集的索引鍵和值,建置 IConfiguration

(繼承來源 IConfigurationBuilder)
GetChildren()

取得直接子系組態子區段。

(繼承來源 IConfiguration)
GetReloadToken()

傳回 IChangeToken,這個 IChangeToken 可用來觀察此設定重載時。

(繼承來源 IConfiguration)
GetSection(String)

取得具有指定索引鍵的組態子區段。

(繼承來源 IConfiguration)

擴充方法

AddApplicationMetadata(IConfigurationBuilder, IHostEnvironment, String)

註冊應用程式元數據的組態提供者。

AddConfiguration(IConfigurationBuilder, IConfiguration)

將現有的組態新增至 configurationBuilder

AddConfiguration(IConfigurationBuilder, IConfiguration, Boolean)

將現有的組態新增至 configurationBuilder

AddCommandLine(IConfigurationBuilder, Action<CommandLineConfigurationSource>)

新增從命令行讀取組態值的 IConfigurationProvider

AddCommandLine(IConfigurationBuilder, String[])

新增從命令行讀取組態值的 CommandLineConfigurationProvider

AddCommandLine(IConfigurationBuilder, String[], IDictionary<String,String>)

新增 CommandLineConfigurationProvider,以使用指定的交換器對應,從命令行讀取組態值。

Bind(IConfiguration, Object)

嘗試將指定的物件實例系結至組態值,方法是以遞歸方式比對組態索引鍵的屬性名稱。

Bind(IConfiguration, Object, Action<BinderOptions>)

嘗試將指定的物件實例系結至組態值,方法是以遞歸方式比對組態索引鍵的屬性名稱。

Bind(IConfiguration, String, Object)

嘗試將指定的物件實例系結至索引鍵所指定的組態區段,方法是以遞歸方式比對組態索引鍵的屬性名稱。

Get(IConfiguration, Type)

嘗試將組態實例系結至 T 類型的新實例。如果此組態區段具有值,將會使用該值。 否則,請以遞歸方式將屬性名稱與組態索引鍵比對。

Get(IConfiguration, Type, Action<BinderOptions>)

嘗試將組態實例系結至 T 類型的新實例。如果此組態區段具有值,將會使用該值。 否則,請以遞歸方式將屬性名稱與組態索引鍵比對。

Get<T>(IConfiguration)

嘗試將組態實例系結至 T 類型的新實例。如果此組態區段具有值,將會使用該值。 否則,請以遞歸方式將屬性名稱與組態索引鍵比對。

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

嘗試將組態實例系結至 T 類型的新實例。如果此組態區段具有值,將會使用該值。 否則,請以遞歸方式將屬性名稱與組態索引鍵比對。

GetValue(IConfiguration, Type, String)

使用指定的索引鍵擷取值,並將它轉換成指定的型別。

GetValue(IConfiguration, Type, String, Object)

使用指定的索引鍵擷取值,並將它轉換成指定的型別。

GetValue<T>(IConfiguration, String)

使用指定的索引鍵擷取值,並將它轉換成 T 類型。

GetValue<T>(IConfiguration, String, T)

使用指定的索引鍵擷取值,並將它轉換成 T 類型。

Add<TSource>(IConfigurationBuilder, Action<TSource>)

新增組態來源。

AsEnumerable(IConfiguration)

取得 IConfiguration內的機碼/值組列舉。

AsEnumerable(IConfiguration, Boolean)

取得 IConfiguration內的機碼/值組列舉。

GetConnectionString(IConfiguration, String)

從組態來源的 ConnectionStrings 區段擷取具有指定索引鍵的值。 呼叫此方法是 GetSection("ConnectionStrings")[name]的速記。

GetRequiredSection(IConfiguration, String)

取得具有指定索引鍵的組態子區段。

AddEnvironmentVariables(IConfigurationBuilder)

新增從環境變數讀取組態值的 IConfigurationProvider

AddEnvironmentVariables(IConfigurationBuilder, Action<EnvironmentVariablesConfigurationSource>)

新增從環境變數讀取組態值的 IConfigurationProvider

AddEnvironmentVariables(IConfigurationBuilder, String)

新增 IConfigurationProvider,從具有指定前置詞的環境變數讀取組態值。

GetFileLoadExceptionHandler(IConfigurationBuilder)

取得要用於檔案型提供者的預設 IFileProvider

GetFileProvider(IConfigurationBuilder)

取得要用於檔案型提供者的預設 IFileProvider

SetBasePath(IConfigurationBuilder, String)

將檔案型提供者的 FileProvider 設定為具有基底路徑的 PhysicalFileProvider。

SetFileLoadExceptionHandler(IConfigurationBuilder, Action<FileLoadExceptionContext>)

設定發生錯誤時,要針對檔案型提供者叫用的默認動作。

SetFileProvider(IConfigurationBuilder, IFileProvider)

設定要用於檔案型提供者的預設 IFileProvider

AddIniFile(IConfigurationBuilder, IFileProvider, String, Boolean, Boolean)

將 INI 組態來源新增至 builder

AddIniFile(IConfigurationBuilder, Action<IniConfigurationSource>)

將 INI 組態來源新增至 builder

AddIniFile(IConfigurationBuilder, String)

將位於 path 的 INI 組態提供者新增至 builder

AddIniFile(IConfigurationBuilder, String, Boolean)

將位於 path 的 INI 組態提供者新增至 builder

AddIniFile(IConfigurationBuilder, String, Boolean, Boolean)

將位於 path 的 INI 組態提供者新增至 builder

AddIniStream(IConfigurationBuilder, Stream)

將 INI 組態來源新增至 builder

AddJsonFile(IConfigurationBuilder, IFileProvider, String, Boolean, Boolean)

將 JSON 組態來源新增至 builder

AddJsonFile(IConfigurationBuilder, Action<JsonConfigurationSource>)

將 JSON 組態來源新增至 builder

AddJsonFile(IConfigurationBuilder, String)

將位於 path 的 JSON 組態提供者新增至 builder

AddJsonFile(IConfigurationBuilder, String, Boolean)

將位於 path 的 JSON 組態提供者新增至 builder

AddJsonFile(IConfigurationBuilder, String, Boolean, Boolean)

將位於 path 的 JSON 組態提供者新增至 builder

AddJsonStream(IConfigurationBuilder, Stream)

將 JSON 組態來源新增至 builder

AddKeyPerFile(IConfigurationBuilder, Action<KeyPerFileConfigurationSource>)

使用目錄中的檔案新增組態。 檔名會當做索引鍵使用,檔案內容會當做值使用。

AddKeyPerFile(IConfigurationBuilder, String)

使用目錄中的檔案新增組態。 檔名會當做索引鍵使用,檔案內容會當做值使用。

AddKeyPerFile(IConfigurationBuilder, String, Boolean)

使用目錄中的檔案新增組態。 檔名會當做索引鍵使用,檔案內容會當做值使用。

AddKeyPerFile(IConfigurationBuilder, String, Boolean, Boolean)

使用目錄中的檔案新增組態。 檔名會當做索引鍵使用,檔案內容會當做值使用。

AddInMemoryCollection(IConfigurationBuilder)

將記憶體群組態提供者新增至 configurationBuilder

AddInMemoryCollection(IConfigurationBuilder, IEnumerable<KeyValuePair<String,String>>)

將記憶體群組態提供者新增至 configurationBuilder

AddUserSecrets(IConfigurationBuilder, Assembly)

新增使用者秘密組態來源。 這會搜尋 assemblyUserSecretsIdAttribute實例,這個實例會指定使用者密碼標識碼。

使用者秘密標識碼是用來儲存和識別秘密組態值集合的唯一值。

AddUserSecrets(IConfigurationBuilder, Assembly, Boolean)

新增使用者秘密組態來源。 這會搜尋 assemblyUserSecretsIdAttribute實例,這個實例會指定使用者密碼標識碼。

使用者秘密標識碼是用來儲存和識別秘密組態值集合的唯一值。

AddUserSecrets(IConfigurationBuilder, Assembly, Boolean, Boolean)

新增使用者秘密組態來源。 這會搜尋 assemblyUserSecretsIdAttribute實例,這個實例會指定使用者密碼標識碼。

使用者秘密標識碼是用來儲存和識別秘密組態值集合的唯一值。

AddUserSecrets(IConfigurationBuilder, String)

新增具有指定使用者密碼識別碼的用戶密碼組態來源。

使用者秘密標識碼是用來儲存和識別秘密組態值集合的唯一值。

AddUserSecrets(IConfigurationBuilder, String, Boolean)

新增具有指定使用者密碼識別碼的用戶密碼組態來源。

使用者秘密標識碼是用來儲存和識別秘密組態值集合的唯一值。

AddUserSecrets<T>(IConfigurationBuilder)

新增使用者秘密組態來源。 搜尋包含類型 T 的元件,以取得 UserSecretsIdAttribute實例,其會指定使用者密碼識別碼。

使用者秘密標識碼是用來儲存和識別秘密組態值集合的唯一值。

AddUserSecrets<T>(IConfigurationBuilder, Boolean)

新增使用者秘密組態來源。 搜尋包含類型 T 的元件,以取得 UserSecretsIdAttribute實例,其會指定使用者密碼識別碼。

使用者秘密標識碼是用來儲存和識別秘密組態值集合的唯一值。

AddUserSecrets<T>(IConfigurationBuilder, Boolean, Boolean)

新增使用者秘密組態來源。 搜尋包含類型 T 的元件,以取得 UserSecretsIdAttribute實例,其會指定使用者密碼識別碼。

使用者秘密標識碼是用來儲存和識別秘密組態值集合的唯一值。

AddXmlFile(IConfigurationBuilder, IFileProvider, String, Boolean, Boolean)

將 XML 組態來源新增至 builder

AddXmlFile(IConfigurationBuilder, Action<XmlConfigurationSource>)

將 XML 組態來源新增至 builder

AddXmlFile(IConfigurationBuilder, String)

將位於 path 的 XML 組態提供者加入至 builder

AddXmlFile(IConfigurationBuilder, String, Boolean)

將位於 path 的 XML 組態提供者加入至 builder

AddXmlFile(IConfigurationBuilder, String, Boolean, Boolean)

將位於 path 的 XML 組態提供者加入至 builder

AddXmlStream(IConfigurationBuilder, Stream)

將 XML 組態來源新增至 builder

適用於