JsonRpcError.ErrorDetail.GetData Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
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.