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
typeInfoJsonTypeInfo<T>The JsonTypeInfo<T> to use for deserialization.
cancellationCancellationTokenA CancellationToken to cancel the asynchronous operation.
Returns
- ValueTask<T>
A ValueTask<TResult> that represents the asynchronous deserialization operation.
Type Parameters
TThe 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.
[RequiresDynamicCode("JSON deserialization without a type info may require types that cannot be statically analyzed.")]
[RequiresUnreferencedCode("JSON deserialization without a type info may require types that cannot be statically analyzed.")]
public ValueTask<T?> GetJsonContentAsync<T>(JsonSerializerOptions? jsonOptions, CancellationToken cancellation = default)
Parameters
jsonOptionsJsonSerializerOptionsThe JsonSerializerOptions to use for deserialization.
cancellationCancellationTokenA CancellationToken to cancel the asynchronous operation.
Returns
- ValueTask<T>
A ValueTask<TResult> that represents the asynchronous deserialization operation.
Type Parameters
TThe 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.
[RequiresDynamicCode("JSON deserialization without a type info may require types that cannot be statically analyzed.")]
[RequiresUnreferencedCode("JSON deserialization without a type info may require types that cannot be statically analyzed.")]
public ValueTask<T?> GetJsonContentAsync<T>(CancellationToken cancellation = default)
Parameters
cancellationCancellationTokenA CancellationToken to cancel the asynchronous operation.
Returns
- ValueTask<T>
A ValueTask<TResult> that represents the asynchronous deserialization operation.
Type Parameters
TThe type of the object to deserialize into.
English
Русский
Português
Español
Deutsch
中文 (简体)
日本語