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
namestringThe name of the top-level property.
valueTReceives 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
TThe type to deserialize the value as, if it is present.
Exceptions
- InvalidOperationException
May be thrown when called on an outbound message.
- ArgumentNullException
Thrown when
nameis null.- ArgumentException
Thrown when
nameis 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
namestringThe name of the property. This should not collide with any property defined by the JSON-RPC specification.
valueTThe value for the property.
Returns
Type Parameters
TThe type of value to be serialized.
Exceptions
- InvalidOperationException
May be thrown when called on an inbound message.
- ArgumentNullException
Thrown when
nameis null.- ArgumentException
Thrown when
nameis reserved by the JSON-RPC spec.