📜  静态类中的连接字符串 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:11.851000             🧑  作者: Mango

代码示例1
1.In startup.cs
public Startup(IConfiguration configuration)
{
    Configuration = configuration;
    StaticConfig = configuration;
}

public static IConfiguration StaticConfig { get; private set; }


2.IN Your Static Class
string connString = Startup.StaticConfig.GetConnectionString("DefaultConnection");