Method GetJsonContentAsync
GetJsonContentAsync<T>(JsonTypeInfo<T>, CancellationToken)
Asynchronously deserializes the request body into an object of type T
using the provided JsonTypeInfo<T>.
public ValueTask<T?> GetJsonContentAsync<T>(JsonTypeInfo<T> typeInfo, CancellationToken cancellation = default)
Parameters
typeInfo
JsonTypeInfo<T>The JsonTypeInfo<T> to use for deserialization.
cancellation
CancellationTokenA CancellationToken to cancel the asynchronous operation.
Returns
- ValueTask<T>
A ValueTask<TResult> that represents the asynchronous deserialization operation.
Type Parameters
T
The type of the object to deserialize into.
GetJsonContentAsync<T>(JsonSerializerOptions?, CancellationToken)
Asynchronously deserializes the request body into an object of type T
using the provided JsonSerializerOptions.
public ValueTask<T?> GetJsonContentAsync<T>(JsonSerializerOptions? jsonOptions, CancellationToken cancellation = default)
Parameters
jsonOptions
JsonSerializerOptionsThe JsonSerializerOptions to use for deserialization.
cancellation
CancellationTokenA CancellationToken to cancel the asynchronous operation.
Returns
- ValueTask<T>
A ValueTask<TResult> that represents the asynchronous deserialization operation.
Type Parameters
T
The type of the object to deserialize into.
GetJsonContentAsync<T>(CancellationToken)
Asynchronously deserializes the request body into an object of type T
using the default JsonSerializerOptions.
public ValueTask<T?> GetJsonContentAsync<T>(CancellationToken cancellation = default)
Parameters
cancellation
CancellationTokenA CancellationToken to cancel the asynchronous operation.
Returns
- ValueTask<T>
A ValueTask<TResult> that represents the asynchronous deserialization operation.
Type Parameters
T
The type of the object to deserialize into.