Created
May 23, 2020 16:11
-
-
Save corespider/6f63799e5556145d2ddc4cf83e02e897 to your computer and use it in GitHub Desktop.
Core Spider- Set Connection String Globally
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public IConfigurationRoot ConfigurationRoot { get; set; } | |
public static string ConnectionString { get; private set; } | |
public Startup(IConfiguration config,IWebHostEnvironment env) | |
{ | |
ConfigurationRoot = new ConfigurationBuilder() | |
.SetBasePath(env.ContentRootPath) | |
.AddJsonFile("appSettings.json") | |
.Build(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment