aloneguid / config

⚙ Config.Net - the easiest configuration framework for .NET developers. No BS.
MIT License
641 stars 85 forks source link

Changes on nested interfaces properties are not saved when using JSON #133

Closed daniol closed 1 year ago

daniol commented 2 years ago

I used the basic example:

public interface ICreds
{
   string Username { get; }
   string Password { get; }
}

public interface IConfig
{
   ICreds Admin { get; }
   ICreds Normal { get; }
}

The configuration can be read from the file with:

IConfig config = new ConfigurationBuilder<IConfig>().UseJsonFile("config.json").Build();

But when a change is done in a nested property, the JSON file is not updated:

config.Normal.Username = "changed";

JSON file before (empty object)

{
}

JSON file after (empty object)

{
}
aloneguid commented 1 year ago

Fixed in v5.0.3.