Quickstart
Here's the simplest way to experience Vostok.Configuration for the first time:
Install main, abstractions and sources.json modules:
Install-Package Vostok.Configuration
Install-Package Vostok.Configuration.Abstractions
Install-Package Vostok.Configuration.Sources.Json
Define a settings model class:
class MySettings
{
public string Key1 { get; }
public string Key2 { get; }
}
Create a JSON file with settings:
{
"key1": "value1",
"key2": "value2"
}
Obtain a model instance with a configuration provider from a file source and print it:
var provider = new ConfigurationProvider();
provider.SetupSourceFor<MySettings>(new JsonFileSource("settings.json"));
var settings = provider.Get<MySettings>();
Console.Out.WriteLine(ConfigurationPrinter.Print(settings));
Great job! Here are some possible next steps:
Learn the most basic concepts: settings nodes, sources, binding, provider;
Explore available modules and source implementations;
Go over the basic scenarios section.
Last updated
Was this helpful?