appsettings.json里可以使用变量吗?
appsettings.json内容如下
{
ServiceName:"adnc.xxx.webapi"
Consul:{
ServiceName:"adnc.xxx.webapi"
}
Skywalking:{
ServiceName:"adnc.xxx.webapi"
}
}
有没有办法变成这样
{
ServiceName:"adnc.xxx.webapi"
Consul:{
ServiceName:"这里想直接从ServiceName获取"
}
Skywalking:{
ServiceName:"这里想直接从ServiceName获取"
}
}
回答
https://github.com/pengweiqhca/Microsoft.Extensions.Configuration.Placeholder