8.6K Star 14.2K Fork 4.2K

GVPdotNET China/Furion

 / 详情

应该怎么读 application.json中的数组

已完成
创建于  
2020-12-02 19:21

App.Configuration["EsConfig:ConnectionStrings"];
{
"EsConfig": {
"ConnectionStrings": [ "http://127.0.0.1:9200/","http://127.0.0.1:9300/" ]
}
}
应该怎么读 用App.Configuration["EsConfig:ConnectionStrings"]; 返回是null

评论 (4)

李永波 创建了任务 4年前
李永波 关联仓库设置为百小僧/Furion 4年前
展开全部操作日志

您确定json文件右键属性设置为复制了吗?

确定 App.Configuration["EsConfig:ConnectionStrings:0"] 可以读到第一个

@cicool 您可以看看微软的配置文档数组不是这样读的。配置只能获取最终根结点。

App.Configuration.GetSection("EsConfig:ConnectionStrings").GetChildren() 能读到全部

百小僧 负责人设置为百小僧 4年前
百小僧 添加了
 
疑问
标签
4年前
百小僧 添加了
 
无法实现
标签
4年前
百小僧 关联分支设置为master 4年前
百小僧 计划截止日期设置为2020-12-04 4年前
百小僧 计划开始日期设置为2020-12-03 4年前
百小僧 任务状态待办的 修改为已完成 4年前
百小僧 关联分支master 修改为未关联 2年前

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(2)
974299 monksoul 1578937227 17683 cicool 1578915168
C#
1
https://gitee.com/dotnetchina/Furion.git
git@gitee.com:dotnetchina/Furion.git
dotnetchina
Furion
Furion

搜索帮助