Answers for "connection string in static class"

0

connection string in static class

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");
Posted by: Guest on June-28-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language