JsonRpcError.ErrorDetail.GetData Method

Definition

Overloads

GetData(Type)

Gets the value of the Data, taking into account any possible type coercion.

GetData<T>()

Gets the value of the Data, taking into account any possible type coercion.

GetData(Type)

Gets the value of the Data, taking into account any possible type coercion.

public virtual object? GetData (Type dataType);
abstract member GetData : Type -> obj
override this.GetData : Type -> obj
Public Overridable Function GetData (dataType As Type) As Object

Parameters

dataType
Type

The Type to deserialize the data object to.

Returns

The result.

Exceptions

Thrown if dataType is null.

Remarks

Derived types may override this method in order to deserialize the Data such that it can be assignable to dataType. The default implementation does nothing to convert the Data object to match dataType, but simply returns the existing object. Derived types should *not* throw exceptions. This is a best effort method and returning null or some other value is preferable to throwing as it can disrupt an existing exception handling path.

Applies to

GetData<T>()

Gets the value of the Data, taking into account any possible type coercion.

public T GetData<T> ();
member this.GetData : unit -> 'T
Public Function GetData(Of T) () As T

Type Parameters

T

The Type to coerce the Data to.

Returns

T

The result.

Applies to