Skip to content

A Simple Configuration Management Library for .Net Standard

Notifications You must be signed in to change notification settings

oguzhankiyar/confix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OK.Confix

A Simple Configuration Management Library for .Net

Setup

Setup Using Sql Server

using OK.Confix;
using OK.Confix.SqlServer;
using OK.Confix.WebUI;

...

IConfixContext confix = Confix.New()
    .UseConfix((config) =>
    {
        config.SetApplication("OK.Confix.Samples.Web")
              .SetEnvironment("Development")
              .UseCache(60000);
    })
    .WithSqlServer((config) =>
    {
        config.SetConnectionString("Server=OKCOMPUTER;Database=OK.Confix;Trusted_Connection=True;MultipleActiveResultSets=True;")
              .SetIsDatabaseInitializationEnabled(true);
    })
    .WithWebUI((config) =>
    {
        config.SetRoute(app, "confix");
    })
    .Build();

Setup Using File System

using OK.Confix;
using OK.Confix.FileSystem;
using OK.Confix.WebUI;

...

IConfixContext confix = Confix.New()
    .UseConfix((config) =>
    {
        config.SetApplication("OK.Confix.Samples.Web")
              .SetEnvironment("Development")
              .UseCache(60000);
    })
    .WithFileSystem((config) =>
    {
        config.SetPath(env.WebRootPath)
              .SetFileName("app");
    })
    .WithWebUI((config) =>
    {
        config.SetRoute(app, "confix");
    })
    .Build();

Usage

Set Value

confix.Set("AppName", "The App");

Get Value

string appName = confix.Get<string>("AppName");