小编Mat*_*att的帖子

ASP.Net JSON配置文件使用数组进行转换

我有一个基本配置文件,例如.

appsettings.json

{
    "Values": {
        "Test": ["one", "two"]
    }
}
Run Code Online (Sandbox Code Playgroud)

appsettings.dev.json

{
    "Values": {
        "Test": ["three"]
    }
}
Run Code Online (Sandbox Code Playgroud)

在转换之后,数组将是

["three", "two"]
Run Code Online (Sandbox Code Playgroud)

如何确保转换后的数组缩小到较少数量的元素,而不是每个元素单独更改?

c# asp.net appsettings .net-core asp.net-core

6
推荐指数
1
解决办法
1832
查看次数

标签 统计

.net-core ×1

appsettings ×1

asp.net ×1

asp.net-core ×1

c# ×1