Store / Retrieve ConnectionString from appSettings.json in ASP.net Core 2 MVC app

Define your connection string(s) in appsettings.json { “connectionStrings”: { “appDbConnection”: “…” } } Read its value on Startup If you follow the convention and define your connection string(s) under connectionStrings, you can use the extension method GetConnectionString() to read its value. public class Startup { public IConfiguration Configuration { get; private set; } public Startup(IConfiguration … Read more