Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

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");  

Comment

PREVIOUS NEXT
Code Example
Csharp :: find-text-in-string-with-c-sharp 
Csharp :: how to set the frame rate unity 
Csharp :: c# double to string with dot 
Csharp :: get child of transform by index unity 
Csharp :: c# type from string 
Csharp :: Open another form with C# Winforms 
Csharp :: unity RemoveComponent 
Csharp :: c# get command line arguments 
Csharp :: restart level unity 
Csharp :: unity c# debug.log 
Csharp :: unity how to get a child from a gameobject 
Csharp :: const class in c sharp 
Csharp :: create instance of class given class name string c# 
Csharp :: unity quaternion 
Csharp :: c# get array subarray 
Csharp :: c# cast to int 
Csharp :: unity rotate direction by angle 
Csharp :: c# reflection resize array 
Csharp :: save byte array to file c# 
Csharp :: c# optional parameters 
Csharp :: unity joystick movement 
Csharp :: c# get list of all class fields 
Csharp :: c# contains() 
Csharp :: database update dotnet 
Csharp :: how to run async void function c# 
Csharp :: event trigger by code unity 
Csharp :: how to create a list c# 
Csharp :: read file using c# 
Csharp :: c# string contains 
Csharp :: or in if statement c# 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =