📅  最后修改于: 2022-03-11 15:02:11.851000             🧑  作者: Mango
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");