Replies: 1 comment
-
|
Hi :) An example: `using System; public class Program string json2 = @"{ JsonDocument doc1 = JsonDocument.Parse(json1); var dict1 = new Dictionary<string, JsonElement>(); var dict2 = new Dictionary<string, JsonElement>(); foreach (var item in dict2) string mergedJson = JsonSerializer.Serialize(dict1); Result: {"propA":"myPropPlus","some_other_prop":1234,"propB":true} |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a json named a:
{ "propA":"myProp", "some_other_prop":1234 }and a json named b:
{ "propA":"myPropPlus", "propB": true }how can i merge these two json by using System.Text.Json.JsonDocument ?
the expected result:
{ "propA":"myPropPlus", "propB": true, "some_other_prop":1234 }Beta Was this translation helpful? Give feedback.
All reactions