Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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");
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #connection #string #static #class
ADD COMMENT
Topic
Name
3+8 =