I have two JToken's that represent JSON arrays of objects and I would like to merge them. JToken has a method Concat but it produces null as result when I try to use it.
Action<JToken> Ok = (x) =>
{
Debug.WriteLine(x);
/* outputs
[
{
"id": 1,
},
{
"id": 2,
}
]
*/
x = (x).Concat<JToken>(x) as JToken;
Debug.WriteLine(x); // null
};
How can I make it work?
Concatmethod by providing your code + sample data?x = (x).Concat<JToken>(x) as JToken. UPD: can you see the code block I've provided?concatis usually for joining two strings. I would expect amergeorunionfunction would be more applicable. Does such a thing exist?