JsonRpcMessage.TryGetTopLevelProperty<T>(String, T) Method

Definition

Retrieves a top-level property from an incoming message that is an extension to the JSON-RPC specification.

public virtual bool TryGetTopLevelProperty<T> (string name, out T value);
abstract member TryGetTopLevelProperty : string * 'T -> bool
override this.TryGetTopLevelProperty : string * 'T -> bool
Public Overridable Function TryGetTopLevelProperty(Of T) (name As String, ByRef value As T) As Boolean

Type Parameters

T

The type to deserialize the value as, if it is present.

Parameters

name
String

The name of the top-level property.

value
T

Receives the deserialized value if the IJsonRpcMessageFormatter supports reading such properties and the property is present in the message. Otherwise, this parameter is set to its default value.

Returns

true if the IJsonRpcMessageFormatter supports this extensibility and the property was present on the message; otherwise false.

Exceptions

May be thrown when called on an outbound message.

Thrown when name is null.

Thrown when name is reserved by the JSON-RPC spec.

Applies to