EnvironmentVariablesExtensions.AddEnvironmentVariables 方法

定義

多載

AddEnvironmentVariables(IConfigurationBuilder)

新增從環境變數讀取組態值的 IConfigurationProviderAdds an IConfigurationProvider that reads configuration values from environment variables.

AddEnvironmentVariables(IConfigurationBuilder, Action<EnvironmentVariablesConfigurationSource>)

新增從環境變數讀取組態值的 IConfigurationProviderAdds an IConfigurationProvider that reads configuration values from environment variables.

AddEnvironmentVariables(IConfigurationBuilder, String)

新增 IConfigurationProvider 來從具有指定前置詞的環境變數中讀取組態值。Adds an IConfigurationProvider that reads configuration values from environment variables with a specified prefix.

AddEnvironmentVariables(IConfigurationBuilder)

新增從環境變數讀取組態值的 IConfigurationProviderAdds an IConfigurationProvider that reads configuration values from environment variables.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Configuration::IConfigurationBuilder ^ AddEnvironmentVariables(Microsoft::Extensions::Configuration::IConfigurationBuilder ^ configurationBuilder);
public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddEnvironmentVariables (this Microsoft.Extensions.Configuration.IConfigurationBuilder configurationBuilder);
static member AddEnvironmentVariables : Microsoft.Extensions.Configuration.IConfigurationBuilder -> Microsoft.Extensions.Configuration.IConfigurationBuilder
<Extension()>
Public Function AddEnvironmentVariables (configurationBuilder As IConfigurationBuilder) As IConfigurationBuilder

參數

configurationBuilder
IConfigurationBuilder

要新增的目標 IConfigurationBuilderThe IConfigurationBuilder to add to.

傳回

IConfigurationBuilder

IConfigurationBuilderThe IConfigurationBuilder.

適用於

AddEnvironmentVariables(IConfigurationBuilder, Action<EnvironmentVariablesConfigurationSource>)

新增從環境變數讀取組態值的 IConfigurationProviderAdds an IConfigurationProvider that reads configuration values from environment variables.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Configuration::IConfigurationBuilder ^ AddEnvironmentVariables(Microsoft::Extensions::Configuration::IConfigurationBuilder ^ builder, Action<Microsoft::Extensions::Configuration::EnvironmentVariables::EnvironmentVariablesConfigurationSource ^> ^ configureSource);
public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddEnvironmentVariables (this Microsoft.Extensions.Configuration.IConfigurationBuilder builder, Action<Microsoft.Extensions.Configuration.EnvironmentVariables.EnvironmentVariablesConfigurationSource> configureSource);
static member AddEnvironmentVariables : Microsoft.Extensions.Configuration.IConfigurationBuilder * Action<Microsoft.Extensions.Configuration.EnvironmentVariables.EnvironmentVariablesConfigurationSource> -> Microsoft.Extensions.Configuration.IConfigurationBuilder
<Extension()>
Public Function AddEnvironmentVariables (builder As IConfigurationBuilder, configureSource As Action(Of EnvironmentVariablesConfigurationSource)) As IConfigurationBuilder

參數

builder
IConfigurationBuilder

要新增的目標 IConfigurationBuilderThe IConfigurationBuilder to add to.

configureSource
Action<EnvironmentVariablesConfigurationSource>

設定來源。Configures the source.

傳回

IConfigurationBuilder

IConfigurationBuilderThe IConfigurationBuilder.

適用於

AddEnvironmentVariables(IConfigurationBuilder, String)

新增 IConfigurationProvider 來從具有指定前置詞的環境變數中讀取組態值。Adds an IConfigurationProvider that reads configuration values from environment variables with a specified prefix.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Configuration::IConfigurationBuilder ^ AddEnvironmentVariables(Microsoft::Extensions::Configuration::IConfigurationBuilder ^ configurationBuilder, System::String ^ prefix);
public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddEnvironmentVariables (this Microsoft.Extensions.Configuration.IConfigurationBuilder configurationBuilder, string prefix);
static member AddEnvironmentVariables : Microsoft.Extensions.Configuration.IConfigurationBuilder * string -> Microsoft.Extensions.Configuration.IConfigurationBuilder
<Extension()>
Public Function AddEnvironmentVariables (configurationBuilder As IConfigurationBuilder, prefix As String) As IConfigurationBuilder

參數

configurationBuilder
IConfigurationBuilder

要新增的目標 IConfigurationBuilderThe IConfigurationBuilder to add to.

prefix
String

環境變數名稱必須以其為開頭的前置詞。The prefix that environment variable names must start with. 前置詞將會從環境變數名稱中移除。The prefix will be removed from the environment variable names.

傳回

IConfigurationBuilder

IConfigurationBuilderThe IConfigurationBuilder.

適用於