在 Asp.Net Core 3.1 应用程序上,我在 AppSettings 上有以下部分:
"Logins": [
{
"Name": "Facebook",
"Id": "fb_id",
"Secret": "fb_secret"
},
{
"Name": "Google",
"Id": "go_id",
"Secret": "go_secret"
}
]
我正在尝试获取值,例如 Facebook 的 ID,所以我尝试了:
Configuration.GetValue<String>("Logins:Facebook:Id")
但这不起作用......我怎样才能得到这些值?