.net core 读取配置文件的值
.net core中的配置文件可以存一些自定义的值,我们需要去读取
在配置中添加json:
"name": "sealee", "ConnectionStrings": { "SqlServerConnection": "Development.json" }, "JwtSettings": { "Issuer": "ss", "Audience": "aa", "SecretKey": "djwidwhjidwjd" },
①介绍
②控制器中怎么得到对象配置
GetSection,GetChildren,Exists的介绍:https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/configuration/?view=aspnetcore-2.2#getsection-getchildren-and-exists