-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
api-suggestionEarly API idea and discussion, it is NOT ready for implementationEarly API idea and discussion, it is NOT ready for implementationarea-Extensions-Configuration
Milestone
Description
From @LordXaosa on Thursday, 18 October 2018 09:39:00
Code:
class TestClass
{
public TestClass()
{
TestArray = new[] { "123", "test1" };
}
public string[] TestArray { get; set; }
}
class MyConfig
{
public TestClass Test{ get; set; }
}MyConfig cfg = new MyConfig();
IConfiguration config = new ConfigurationBuilder()
.SetBasePath(AppDomain.CurrentDomain.BaseDirectory)
.AddJsonFile("appsettings.json")
.Build();
config.Bind(cfg);in appsettings.json:
{
"Test": {
"TestArray": [ "3", "4" ]
}
}I expect after config loading there would be only 2 items: "3" and "4"
But there would be all 4. "123","test1","3","4"
Consider this is a bug or there should be an option for replacing array values.
Copied from original issue: dotnet/aspnetcore#3666
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api-suggestionEarly API idea and discussion, it is NOT ready for implementationEarly API idea and discussion, it is NOT ready for implementationarea-Extensions-Configuration