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");