ParallelModelResponseExtensions.AsTyped<TData> method
Converts the JSON data of an untyped response to the specified reference type while preserving the original status code, response text and headers.
public static ParallelModelResponse<TData> AsTyped<TData>(this ParallelModelResponse response,
JsonSerializerOptions? options = null)
where TData : class
| parameter | description |
|---|---|
| TData | The reference type into which the JSON data is deserialized. |
| response | The untyped API response to convert. |
| options | Optional JSON serializer settings. A copy is used when supplied, so the original settings are not modified. |
Return Value
A strongly typed response containing the deserialized data, or null data when the original JSON is absent, undefined or null.
Exceptions
| exception | condition |
|---|---|
| ArgumentNullException | The response is null. |
| JsonException | The JSON data cannot be deserialized into the specified type. |
| NotSupportedException | No compatible converter is available for the requested type or one of its members. |
Remarks
A flexible GUID converter is inserted at the beginning of the serializer converter collection before deserialization.
See Also
- record ParallelModelResponse<TData>
- record ParallelModelResponse
- class ParallelModelResponseExtensions
- namespace ParallelModel.Sdk