Description
Before this changes I could convert any non-terminal section (section that doesn't have a value, but has child keys) to an array as shown the example below. This is not possible in the current implementation.
var configRoot = new ConfigurationBuilder()
.AddInMemoryCollection(new KeyValuePair<string, string>[]
{
new("section:key1", "1"),
new("section:key2", "2"),
new("section:key3", "3")
/**
{
"section": {
"key1": "1",
"key2": "2",
"key3": "3"
}
}
*/
})
.Build();
var values = configRoot.GetSection("section").Get<int[]>();
Assert.Equal(3, values.Length);
Assert.Equal(1, values[0]);
Assert.Equal(2, values[1]);
Assert.Equal(3, values[2]);
Other information
This line of code requires the child key (as "key1", "key2", "key3" in example above) to be an integer.
Description
Before this changes I could convert any non-terminal section (section that doesn't have a value, but has child keys) to an array as shown the example below. This is not possible in the current implementation.
Other information
This line of code requires the child key (as "key1", "key2", "key3" in example above) to be an integer.