JsonDocumentPath
JsonDocumentPath copied to clipboard
extend the response to accept key and value
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" } ]