【发布时间】:2020-02-24 20:45:54
【问题描述】:
我有一个以包含所有其余部分的对象开头的 json:
{
"mainObject":
{
"other stuff here 1" : "aaa",
"other stuff here 2" : "bbb",
...
"other stuff here 2000" : "zassbbb"
}
}
我得到整个 json 并将其放入对象中,我怎样才能丢弃“mainObject”部分而只获得最内部的部分?我会在我的对象中有:
"other stuff here 1" : "aaa",
"other stuff here 2" : "bbb",
...
"other stuff here 2000" : "zassbbb"
【问题讨论】:
-
请展示您到目前为止尝试过的内容。您使用的是
Json.NET还是System.Text.Json?基本上,您可以使用JObject轻松完成 -
我目前是作为字符串处理的 我从字符串的开头到结尾去掉了我不感兴趣的部分,但是代码很繁琐
标签: c# json asp.net-core json.net