Class FormatterBase.JsonRpcErrorBase
- Namespace
- StreamJsonRpc
- Assembly
- StreamJsonRpc.dll
A base class for formatter-specific JsonRpcError implementations.
protected abstract class FormatterBase.JsonRpcErrorBase : JsonRpcError, IJsonRpcMessageWithId, IJsonRpcMessageBufferManager, FormatterBase.IMessageWithTopLevelPropertyBag
- Inheritance
-
FormatterBase.JsonRpcErrorBase
- Implements
- Inherited Members
Properties
TopLevelPropertyBag
Gets or sets the top-level property bag for this message.
[JsonIgnore]
[IgnoreDataMember]
[PropertyShape(Ignore = true)]
public FormatterBase.TopLevelPropertyBagBase? TopLevelPropertyBag { get; set; }
Property Value
Methods
CreateTopLevelPropertyBag()
Creates a new instance of the top-level property bag for this message.
protected abstract FormatterBase.TopLevelPropertyBagBase? CreateTopLevelPropertyBag()
Returns
ReleaseBuffers()
When overridden by derived types, clears references to all buffers that may have been used for deserialization.
protected virtual void ReleaseBuffers()
TryGetTopLevelProperty<T>(string, out T)
Retrieves a top-level property from an incoming message that is an extension to the JSON-RPC specification.
public override bool TryGetTopLevelProperty<T>(string name, out T value)
Parameters
name
stringThe name of the top-level property.
value
TReceives 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
- bool
true if the IJsonRpcMessageFormatter supports this extensibility and the property was present on the message; otherwise false.
Type Parameters
T
The type to deserialize the value as, if it is present.
Exceptions
- InvalidOperationException
May be thrown when called on an outbound message.
- ArgumentNullException
Thrown when
name
is null.- ArgumentException
Thrown when
name
is reserved by the JSON-RPC spec.
TrySetTopLevelProperty<T>(string, T)
Sets a top-level property in the message that is an extension to JSON-RPC specification.
public override bool TrySetTopLevelProperty<T>(string name, T value)
Parameters
name
stringThe name of the property. This should not collide with any property defined by the JSON-RPC specification.
value
TThe value for the property.
Returns
Type Parameters
T
The type of value to be serialized.
Exceptions
- InvalidOperationException
May be thrown when called on an inbound message.
- ArgumentNullException
Thrown when
name
is null.- ArgumentException
Thrown when
name
is reserved by the JSON-RPC spec.