I have this JSON, and I want to delete "delta" section with all nested property. I already use JObject.Remove("delta") but I have this error:
Cannot add or remove items from Newtonsoft.Json.Linq.JProperty
JSON
{
"state": {
"desired": {
"optionals": {
"Variant": "XXXX",
"Vehicle": {
"COC00": "AAAA",
"D0000": "BBBB",
"D0600": "CCCC"
}
}
},
"delta": {
"optionals": {
"Variant": "XXXX",
"Vehicle": {
"COC00": "AAAA",
"D0000": "BBBB",
"D0600": "CCCC"
"D2000": "DDDD",
}
}
}
},
"timestamp": 1700154568
}
stateProperty.Remove("delta"). But you would need to call something likestateProperty.Value.Remove("delta")(I'm not sure about the exact API)