Skip to content

extend the response to accept key and value#4

Open
yufeiqi wants to merge 1 commit intoazambrano:masterfrom
yufeiqi:feature/add-key-to-response
Open

extend the response to accept key and value#4
yufeiqi wants to merge 1 commit intoazambrano:masterfrom
yufeiqi:feature/add-key-to-response

Conversation

@yufeiqi
Copy link

@yufeiqi yufeiqi commented Apr 28, 2022

extend the response to JsonElementExt, including name and value.

{ "persons": [ { "name": "John", "age": 26 }, { "name": "Jane", "age": 2 } ] }

var models = JsonDocument.Parse(json).RootElement;
var results = models.SelectExtElements("persons[*].name").ToList();

the results should be
[ { "Element": "John", "Name": "name" }, { "Element": "Jane", "Name": "name" } ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments