Answers for "how to read values from appsettings.json in c#"

C#
0

how to read values from appsettings.json in c#

There are two methods to retrieve our values,

string dbConn = configuration.GetSection("MySettings").GetSection("DbConnection").Value;

string dbConn2 = configuration.GetValue<string>("MySettings:DbConnection");
Posted by: Guest on May-06-2022

Code answers related to "how to read values from appsettings.json in c#"

C# Answers by Framework

Browse Popular Code Answers by Language