A Simple Configuration Management Library for .Net
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();
Set Value
confix.Set("AppName", "The App");
Get Value
string appName = confix.Get<string>("AppName");