Method GetJsonContentAsync<T>
Namespace: Sisk.Core.Http
Assembly: Sisk.Core.dll
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 CancellationToken
A 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.
[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
jsonOptions JsonSerializerOptions?
The JsonSerializerOptions to use for deserialization.
cancellation CancellationToken
A 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.
[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
cancellation CancellationToken
A 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.
English
Русский
Português
Español
Deutsch
中文 (简体)
日本語