Skip to content

LuanRoger/SerializedConfiguration

Repository files navigation

SerializedConfiguration

Create, manage and save settings in .yaml or .json.

Dependencies

Installation

PM

Install-Package SerializedConfig

.NET CLI

dotnet add package SerializedConfig

See also in NuGet Gallery

Simple example:

[ConfigSection]
public class ConfigurationModel : IConfigurationModel
{
    public Person person { get; set; }
    public Person anotherPerson { get; set; }
}
ConfigurationModel configurationModel = new()
{
    person = new()
    {
        name = "Bob",
        age = 68
    },
    anotherPerson = new()
    {
        name = "Anders",
        age = 60
    }
};
            
ConfigManager<ConfigurationModel> configManager = new(Consts.SAVE_FILE_PATH_YAML, SerializationFormat.Yaml, configurationModel);
configManager.Save();

Documentation

Access the documentation on Wiki