Table of Contents

Method GetJsonContentAsync

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.

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.

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.