how to read values from appsettings.json in c# .net core 8 | Read appsettings.json Parameters

preview_player
Показать описание
***************************************************************

In this file, you can keep settings like connection strings, application settings, logging configuration, and anything else you want to change without recompiling your application. The settings in this file can be read at runtime by environment like development and production.

Ex:
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"ConnectionStrings": {
"DefaultConnection": "Server=DESKTOP-21E4D9T; database=brandDB; Integrated Security=True; TrustServerCertificate=true;"
},
"AllowedHosts": "*"
}

************************************
Рекомендации по теме