Tuesday, November 20, 2018

.NET Core: Get IConfiguration object from appsettings.json without injection

IConfiguration Configuration = (IConfiguration)new ConfigurationBuilder().AddJsonFile("appsettings.json").Build();

var connStr = Configuration["ConnectionString:Default"];

No comments:

Post a Comment