Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

uBeac.Configuration: An attractive solution for your JSON configuration files!

Nuget version Nuget downloads

It may have happened to you that your project involved many configurations and you had to put them all in one file called appsettings.json. Well, everything is fine and there is no problem, but we at uBeac.Configuration offer you a more attractive solution.

What is the solution?

Our suggestion is to create a file for each configuration and put it in a folder. For example, we have a folder called Config that contains various JSON configuration files (like connection-strings.json, authentication.json, smtp.json or anything else.)


Start

Install the package with NuGet:

dotnet add package uBeac.Configuration

Register

Just put the following code in Program.cs:

builder.Configuration.AddJsonConfig(builder.Environment, "YourConfigFolderName");

"YourConfigFolderName" is the name of the folder in which your JSON files are located. Default is "Config".

For example:

  • Config
    • connection-strings.json
    • authentication.json
    • smtp.json

In this example, folder name is Config which contains JSON files.

The Config folder must be at the root of the project.