Skip to content

[System.Text.Json] How to create a new array from existing nodes? #64737

Answered by aventus13
aventus13 asked this question in Q&A
Discussion options

You must be logged in to vote

@huoyaoyuan thanks for your reply. Yes, I'm aware that a node can only have one parent however that doesn't really answer my question. How can I clone a node? I'm unable to find any Clone method on either the base JsonNode nor any derived types such as JsonArray or JsonObject.

Please note that I'm trying to avoid having to use serialization/deserialization or reflection.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@huoyaoyuan
Comment options

@danmoseley
Comment options

@huoyaoyuan
Comment options

Answer selected by danmoseley
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
3 participants