【发布时间】:2021-06-20 21:36:34
【问题描述】:
我们对回复 Google HomeGraph 有以下 json 要求。
{
"requestId": "123ABC",
"agentUserId": "user-123",
"payload": {
"devices": {
"states": {
"light-123": {
"on": true
}
}
}
}
}
我可以用 .netcore 2.1 和 NewtonSoft 伪造这个。您如何将其表示为 .netcore 3.1 和 system.text.json 的对象?特别是表示“light-123”的变量字符串。从我正在使用的控制器:
return new JsonResult(jsonObject)
【问题讨论】:
标签: c# actions-on-google asp.net-core-3.1