ConfigurationExtensions.GetConnectionString(IConfiguration, String) 方法

定义

ConnectionStrings 配置源的 节中检索具有指定键的值。 调用此方法是 的 GetSection("ConnectionStrings")[name]简写。

public:
[System::Runtime::CompilerServices::Extension]
 static System::String ^ GetConnectionString(Microsoft::Extensions::Configuration::IConfiguration ^ configuration, System::String ^ name);
public static string? GetConnectionString (this Microsoft.Extensions.Configuration.IConfiguration configuration, string name);
static member GetConnectionString : Microsoft.Extensions.Configuration.IConfiguration * string -> string
<Extension()>
Public Function GetConnectionString (configuration As IConfiguration, name As String) As String

参数

configuration
IConfiguration

配置。

name
String

连接字符串键。

返回

具有指定键的连接字符串。

适用于