JsonPathExtensions Class

Provides JSONPath evaluation helpers for JSON syntax trees.

public static class JsonPathExtensions

Methods

NameDescription
Evaluate(JsonPath, JsonSyntaxNode?)Evaluates this JSONPath expression against a JSON syntax node.
Evaluate(JsonPath, JsonSyntaxNode?, JsonPathEvaluationMode)Evaluates this JSONPath expression against a JSON syntax node.
Evaluate(JsonPath, JsonSyntaxNode?, JsonPathEvaluationOptions, JsonPathEvaluationMode)Evaluates a syntax node using cooperative cancellation and resource limits.
Evaluate(JsonPath, JsonSyntaxTree?)Evaluates this JSONPath expression against a JSON syntax tree.
Evaluate(JsonPath, JsonSyntaxTree?, JsonPathEvaluationMode)Evaluates this JSONPath expression against a JSON syntax tree.
Evaluate(JsonPath, JsonSyntaxTree?, JsonPathEvaluationOptions, JsonPathEvaluationMode)Evaluates a syntax tree using cooperative cancellation and resource limits.
Evaluate(JsonSyntaxNode?, JsonPath)Evaluates a JSONPath expression against this JSON syntax node.
Evaluate(JsonSyntaxNode?, JsonPath, JsonPathEvaluationMode)Evaluates a JSONPath expression against this JSON syntax node.
Evaluate(JsonSyntaxNode?, JsonPath, JsonPathEvaluationOptions, JsonPathEvaluationMode)Evaluates a syntax node using cooperative cancellation and resource limits.
Evaluate(JsonSyntaxTree?, JsonPath)Evaluates a JSONPath expression against this JSON syntax tree.
Evaluate(JsonSyntaxTree?, JsonPath, JsonPathEvaluationMode)Evaluates a JSONPath expression against this JSON syntax tree.
Evaluate(JsonSyntaxTree?, JsonPath, JsonPathEvaluationOptions, JsonPathEvaluationMode)Evaluates a syntax tree using cooperative cancellation and resource limits.
EvaluateValue(JsonPath, JsonSyntaxNode?)Evaluates this JSONPath expression and returns the first matched syntax node, or null when there is no match.
EvaluateValue(JsonPath, JsonSyntaxNode?, JsonPathEvaluationMode)Evaluates this JSONPath expression and returns the first matched syntax node, or null when there is no match.
EvaluateValue(JsonPath, JsonSyntaxNode?, JsonPathEvaluationOptions, JsonPathEvaluationMode)Returns the first syntax node using cooperative cancellation and resource limits.
EvaluateValue(JsonPath, JsonSyntaxTree?)Evaluates this JSONPath expression and returns the first matched syntax node, or null when there is no match.
EvaluateValue(JsonPath, JsonSyntaxTree?, JsonPathEvaluationMode)Evaluates this JSONPath expression and returns the first matched syntax node, or null when there is no match.
EvaluateValue(JsonPath, JsonSyntaxTree?, JsonPathEvaluationOptions, JsonPathEvaluationMode)Returns the first syntax node using cooperative cancellation and resource limits.
EvaluateValue(JsonSyntaxNode?, JsonPath)Evaluates a JSONPath expression against this JSON syntax node and returns the first matched syntax node, or null when there is no match.
EvaluateValue(JsonSyntaxNode?, JsonPath, JsonPathEvaluationMode)Evaluates a JSONPath expression against this JSON syntax node and returns the first matched syntax node, or null when there is no match.
EvaluateValue(JsonSyntaxNode?, JsonPath, JsonPathEvaluationOptions, JsonPathEvaluationMode)Returns the first syntax node using cooperative cancellation and resource limits.
EvaluateValue(JsonSyntaxTree?, JsonPath)Evaluates a JSONPath expression against this JSON syntax tree and returns the first matched syntax node, or null when there is no match.
EvaluateValue(JsonSyntaxTree?, JsonPath, JsonPathEvaluationMode)Evaluates a JSONPath expression against this JSON syntax tree and returns the first matched syntax node, or null when there is no match.
EvaluateValue(JsonSyntaxTree?, JsonPath, JsonPathEvaluationOptions, JsonPathEvaluationMode)Returns the first syntax node using cooperative cancellation and resource limits.

Evaluate overloads

Evaluate(JsonPath, JsonSyntaxNode?)

JsonPathExtensions.cs

Evaluates this JSONPath expression against a JSON syntax node.

public static JsonPathResult<JsonSyntaxNode> Evaluate(this JsonPath path, JsonSyntaxNode? root)
Parameters
path JsonPath
The JSONPath expression to evaluate.
root JsonSyntaxNode?
The root JSON syntax node to query. May be null when the root value is JSON null.
Returns

JsonPathResult<JsonSyntaxNode> A JsonPathResult<TValue> containing all matched syntax nodes.

Exceptions
ArgumentNullException
path is null.

Evaluate(JsonPath, JsonSyntaxNode?, JsonPathEvaluationMode)

JsonPathExtensions.cs

Evaluates this JSONPath expression against a JSON syntax node.

public static JsonPathResult<JsonSyntaxNode> Evaluate(this JsonPath path, JsonSyntaxNode? root, JsonPathEvaluationMode mode)
Parameters
path JsonPath
The JSONPath expression to evaluate.
root JsonSyntaxNode?
The root JSON syntax node to query. May be null when the root value is JSON null.
mode JsonPathEvaluationMode
The evaluation mode.
Returns

JsonPathResult<JsonSyntaxNode> A JsonPathResult<TValue> containing all matched syntax nodes.

Exceptions
ArgumentNullException
path is null.
JsonPathEvaluationException
The path cannot be evaluated in JsonPathEvaluationMode.Strict mode.

Evaluate(JsonPath, JsonSyntaxNode?, JsonPathEvaluationOptions, JsonPathEvaluationMode)

JsonPathExtensions.cs

Evaluates a syntax node using cooperative cancellation and resource limits.

Evaluate(JsonPath, JsonSyntaxTree?)

JsonPathExtensions.cs

Evaluates this JSONPath expression against a JSON syntax tree.

public static JsonPathResult<JsonSyntaxNode> Evaluate(this JsonPath path, JsonSyntaxTree? root)
Parameters
path JsonPath
The JSONPath expression to evaluate.
root JsonSyntaxTree?
The root JSON syntax tree to query. May be null.
Returns

JsonPathResult<JsonSyntaxNode> A JsonPathResult<TValue> containing all matched syntax nodes.

Exceptions
ArgumentNullException
path is null.

Evaluate(JsonPath, JsonSyntaxTree?, JsonPathEvaluationMode)

JsonPathExtensions.cs

Evaluates this JSONPath expression against a JSON syntax tree.

public static JsonPathResult<JsonSyntaxNode> Evaluate(this JsonPath path, JsonSyntaxTree? root, JsonPathEvaluationMode mode)
Parameters
path JsonPath
The JSONPath expression to evaluate.
root JsonSyntaxTree?
The root JSON syntax tree to query. May be null.
mode JsonPathEvaluationMode
The evaluation mode.
Returns

JsonPathResult<JsonSyntaxNode> A JsonPathResult<TValue> containing all matched syntax nodes.

Exceptions
ArgumentNullException
path is null.
JsonPathEvaluationException
The path cannot be evaluated in JsonPathEvaluationMode.Strict mode.

Evaluate(JsonPath, JsonSyntaxTree?, JsonPathEvaluationOptions, JsonPathEvaluationMode)

JsonPathExtensions.cs

Evaluates a syntax tree using cooperative cancellation and resource limits.

Evaluate(JsonSyntaxNode?, JsonPath)

JsonPathExtensions.cs

Evaluates a JSONPath expression against this JSON syntax node.

public static JsonPathResult<JsonSyntaxNode> Evaluate(this JsonSyntaxNode? root, JsonPath path)
Parameters
root JsonSyntaxNode?
The root JSON syntax node to query. May be null when the root value is JSON null.
path JsonPath
The JSONPath expression to evaluate.
Returns

JsonPathResult<JsonSyntaxNode> A JsonPathResult<TValue> containing all matched syntax nodes.

Exceptions
ArgumentNullException
path is null.

Evaluate(JsonSyntaxNode?, JsonPath, JsonPathEvaluationMode)

JsonPathExtensions.cs

Evaluates a JSONPath expression against this JSON syntax node.

public static JsonPathResult<JsonSyntaxNode> Evaluate(this JsonSyntaxNode? root, JsonPath path, JsonPathEvaluationMode mode)
Parameters
root JsonSyntaxNode?
The root JSON syntax node to query. May be null when the root value is JSON null.
path JsonPath
The JSONPath expression to evaluate.
mode JsonPathEvaluationMode
The evaluation mode.
Returns

JsonPathResult<JsonSyntaxNode> A JsonPathResult<TValue> containing all matched syntax nodes.

Exceptions
ArgumentNullException
path is null.
JsonPathEvaluationException
The path cannot be evaluated in JsonPathEvaluationMode.Strict mode.

Evaluate(JsonSyntaxNode?, JsonPath, JsonPathEvaluationOptions, JsonPathEvaluationMode)

JsonPathExtensions.cs

Evaluates a syntax node using cooperative cancellation and resource limits.

Evaluate(JsonSyntaxTree?, JsonPath)

JsonPathExtensions.cs

Evaluates a JSONPath expression against this JSON syntax tree.

public static JsonPathResult<JsonSyntaxNode> Evaluate(this JsonSyntaxTree? root, JsonPath path)
Parameters
root JsonSyntaxTree?
The root JSON syntax tree to query. May be null.
path JsonPath
The JSONPath expression to evaluate.
Returns

JsonPathResult<JsonSyntaxNode> A JsonPathResult<TValue> containing all matched syntax nodes.

Exceptions
ArgumentNullException
path is null.

Evaluate(JsonSyntaxTree?, JsonPath, JsonPathEvaluationMode)

JsonPathExtensions.cs

Evaluates a JSONPath expression against this JSON syntax tree.

public static JsonPathResult<JsonSyntaxNode> Evaluate(this JsonSyntaxTree? root, JsonPath path, JsonPathEvaluationMode mode)
Parameters
root JsonSyntaxTree?
The root JSON syntax tree to query. May be null.
path JsonPath
The JSONPath expression to evaluate.
mode JsonPathEvaluationMode
The evaluation mode.
Returns

JsonPathResult<JsonSyntaxNode> A JsonPathResult<TValue> containing all matched syntax nodes.

Exceptions
ArgumentNullException
path is null.
JsonPathEvaluationException
The path cannot be evaluated in JsonPathEvaluationMode.Strict mode.

Evaluate(JsonSyntaxTree?, JsonPath, JsonPathEvaluationOptions, JsonPathEvaluationMode)

JsonPathExtensions.cs

Evaluates a syntax tree using cooperative cancellation and resource limits.

EvaluateValue overloads

EvaluateValue(JsonPath, JsonSyntaxNode?)

JsonPathExtensions.cs

Evaluates this JSONPath expression and returns the first matched syntax node, or null when there is no match.

public static JsonSyntaxNode? EvaluateValue(this JsonPath path, JsonSyntaxNode? root)
Parameters
path JsonPath
The JSONPath expression to evaluate.
root JsonSyntaxNode?
The root JSON syntax node to query. May be null when the root value is JSON null.
Returns

JsonSyntaxNode? The first matched syntax node, or null when there is no match.

Exceptions
ArgumentNullException
path is null.

EvaluateValue(JsonPath, JsonSyntaxNode?, JsonPathEvaluationMode)

JsonPathExtensions.cs

Evaluates this JSONPath expression and returns the first matched syntax node, or null when there is no match.

public static JsonSyntaxNode? EvaluateValue(this JsonPath path, JsonSyntaxNode? root, JsonPathEvaluationMode mode)
Parameters
path JsonPath
The JSONPath expression to evaluate.
root JsonSyntaxNode?
The root JSON syntax node to query. May be null when the root value is JSON null.
mode JsonPathEvaluationMode
The evaluation mode.
Returns

JsonSyntaxNode? The first matched syntax node, or null when there is no match.

Exceptions
ArgumentNullException
path is null.
JsonPathEvaluationException
The path cannot be evaluated in JsonPathEvaluationMode.Strict mode.

EvaluateValue(JsonPath, JsonSyntaxNode?, JsonPathEvaluationOptions, JsonPathEvaluationMode)

JsonPathExtensions.cs

Returns the first syntax node using cooperative cancellation and resource limits.

public static JsonSyntaxNode? EvaluateValue(this JsonPath path, JsonSyntaxNode? root, JsonPathEvaluationOptions options, JsonPathEvaluationMode mode = (JsonPathEvaluationMode)0)

EvaluateValue(JsonPath, JsonSyntaxTree?)

JsonPathExtensions.cs

Evaluates this JSONPath expression and returns the first matched syntax node, or null when there is no match.

public static JsonSyntaxNode? EvaluateValue(this JsonPath path, JsonSyntaxTree? root)
Parameters
path JsonPath
The JSONPath expression to evaluate.
root JsonSyntaxTree?
The root JSON syntax tree to query. May be null when the root value is JSON null.
Returns

JsonSyntaxNode? The first matched syntax node, or null when there is no match.

Exceptions
ArgumentNullException
path is null.

EvaluateValue(JsonPath, JsonSyntaxTree?, JsonPathEvaluationMode)

JsonPathExtensions.cs

Evaluates this JSONPath expression and returns the first matched syntax node, or null when there is no match.

public static JsonSyntaxNode? EvaluateValue(this JsonPath path, JsonSyntaxTree? root, JsonPathEvaluationMode mode)
Parameters
path JsonPath
The JSONPath expression to evaluate.
root JsonSyntaxTree?
The root JSON syntax tree to query. May be null when the root value is JSON null.
mode JsonPathEvaluationMode
The evaluation mode.
Returns

JsonSyntaxNode? The first matched syntax node, or null when there is no match.

Exceptions
ArgumentNullException
path is null.
JsonPathEvaluationException
The path cannot be evaluated in JsonPathEvaluationMode.Strict mode.

EvaluateValue(JsonPath, JsonSyntaxTree?, JsonPathEvaluationOptions, JsonPathEvaluationMode)

JsonPathExtensions.cs

Returns the first syntax node using cooperative cancellation and resource limits.

public static JsonSyntaxNode? EvaluateValue(this JsonPath path, JsonSyntaxTree? root, JsonPathEvaluationOptions options, JsonPathEvaluationMode mode = (JsonPathEvaluationMode)0)

EvaluateValue(JsonSyntaxNode?, JsonPath)

JsonPathExtensions.cs

Evaluates a JSONPath expression against this JSON syntax node and returns the first matched syntax node, or null when there is no match.

public static JsonSyntaxNode? EvaluateValue(this JsonSyntaxNode? root, JsonPath path)
Parameters
root JsonSyntaxNode?
The root JSON syntax node to query. May be null when the root value is JSON null.
path JsonPath
The JSONPath expression to evaluate.
Returns

JsonSyntaxNode? The first matched syntax node, or null when there is no match.

Exceptions
ArgumentNullException
path is null.

EvaluateValue(JsonSyntaxNode?, JsonPath, JsonPathEvaluationMode)

JsonPathExtensions.cs

Evaluates a JSONPath expression against this JSON syntax node and returns the first matched syntax node, or null when there is no match.

public static JsonSyntaxNode? EvaluateValue(this JsonSyntaxNode? root, JsonPath path, JsonPathEvaluationMode mode)
Parameters
root JsonSyntaxNode?
The root JSON syntax node to query. May be null when the root value is JSON null.
path JsonPath
The JSONPath expression to evaluate.
mode JsonPathEvaluationMode
The evaluation mode.
Returns

JsonSyntaxNode? The first matched syntax node, or null when there is no match.

Exceptions
ArgumentNullException
path is null.
JsonPathEvaluationException
The path cannot be evaluated in JsonPathEvaluationMode.Strict mode.

EvaluateValue(JsonSyntaxNode?, JsonPath, JsonPathEvaluationOptions, JsonPathEvaluationMode)

JsonPathExtensions.cs

Returns the first syntax node using cooperative cancellation and resource limits.

public static JsonSyntaxNode? EvaluateValue(this JsonSyntaxNode? root, JsonPath path, JsonPathEvaluationOptions options, JsonPathEvaluationMode mode = (JsonPathEvaluationMode)0)

EvaluateValue(JsonSyntaxTree?, JsonPath)

JsonPathExtensions.cs

Evaluates a JSONPath expression against this JSON syntax tree and returns the first matched syntax node, or null when there is no match.

public static JsonSyntaxNode? EvaluateValue(this JsonSyntaxTree? root, JsonPath path)
Parameters
root JsonSyntaxTree?
The root JSON syntax tree to query. May be null when the root value is JSON null.
path JsonPath
The JSONPath expression to evaluate.
Returns

JsonSyntaxNode? The first matched syntax node, or null when there is no match.

Exceptions
ArgumentNullException
path is null.

EvaluateValue(JsonSyntaxTree?, JsonPath, JsonPathEvaluationMode)

JsonPathExtensions.cs

Evaluates a JSONPath expression against this JSON syntax tree and returns the first matched syntax node, or null when there is no match.

public static JsonSyntaxNode? EvaluateValue(this JsonSyntaxTree? root, JsonPath path, JsonPathEvaluationMode mode)
Parameters
root JsonSyntaxTree?
The root JSON syntax tree to query. May be null when the root value is JSON null.
path JsonPath
The JSONPath expression to evaluate.
mode JsonPathEvaluationMode
The evaluation mode.
Returns

JsonSyntaxNode? The first matched syntax node, or null when there is no match.

Exceptions
ArgumentNullException
path is null.
JsonPathEvaluationException
The path cannot be evaluated in JsonPathEvaluationMode.Strict mode.

EvaluateValue(JsonSyntaxTree?, JsonPath, JsonPathEvaluationOptions, JsonPathEvaluationMode)

JsonPathExtensions.cs

Returns the first syntax node using cooperative cancellation and resource limits.

public static JsonSyntaxNode? EvaluateValue(this JsonSyntaxTree? root, JsonPath path, JsonPathEvaluationOptions options, JsonPathEvaluationMode mode = (JsonPathEvaluationMode)0)