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

Definition

Sets a top-level property in the message that is an extension to JSON-RPC specification.

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

Type Parameters

T

The type of value to be serialized.

Parameters

name
String

The name of the property. This should not collide with any property defined by the JSON-RPC specification.

value
T

The value for the property.

Returns

true if the formatter supports setting top-level properties; false otherwise.

Exceptions

May be thrown when called on an inbound message.

Thrown when name is null.

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

Applies to