SFERA.Helpers.AppSettingsJSON NuGet Package

Very simple helper for reading, using one single method, keys from local appsettings.json (or whatever file).

Ideal also for reading connection strings.

Here the code:

Console.WriteLine(SFERA.Helpers.AppSettingsJSON.AppSettings.Get("key1"));
Console.WriteLine(SFERA.Helpers.AppSettingsJSON.AppSettings.Get("key2", "D:\\SFERA.Helpers\\Sample\\appsettings.json"));
Console.WriteLine(SFERA.Helpers.AppSettingsJSON.ConnectionStrings.Get("cn1"));
Console.WriteLine(SFERA.Helpers.AppSettingsJSON.ConnectionStrings.Get("cn2", "D:\\SFERA.Helpers\\Sample\\appsettings.json"));

Here the appsettings.json:
{
"ConnectionStrings": {
"cn1": "Persist Security Info=True;Initial Catalog=mycatalog1;server=server.com;User Id=user;Password=pwd;Max Pool Size=500;",
"cn2": "Persist Security Info=True;Initial Catalog=mycatalog2;server=server.com;User Id=user;Password=pwd;Max Pool Size=500;"
},

"AppSettings": {
"key1": "value1",
"key2": "value2"
}.




Got any SFERA.Helpers.AppSettingsJSON Question?





Info

Version: 1.2024.327.3
Author(s): SFERA srl
Last Update: Wednesday, March 27, 2024
.NET Fiddle: Create the first Fiddle
NuGet Url: https://www.nuget.org/packages/SFERA.Helpers.AppSettingsJSON


Install
Install-Package SFERA.Helpers.AppSettingsJSON
dotnet add package SFERA.Helpers.AppSettingsJSON
paket add SFERA.Helpers.AppSettingsJSON
SFERA.Helpers.AppSettingsJSON Download (Unzip the "nupkg" after downloading)

.NETFramework 4.7 net46 net461 net462 net471 net472 net48 net5.0 netcoreapp2.1 netcoreapp3.1




STATS

must-have-score

1

avg-downloads-per-day

5

days-since-last-release

54