Skip to content

DeserializeAsync Method ​

Definition ​

  • Namespace: JASE.Serializers
  • Assembly: JASE.Serializers.dll

Overloads ​

NameDescription
Task<T> DeserializeAsync(Stream json, JsonSerializerOptions options = null, CancellationToken cancellationToken = null)Asynchronously deserialize JSON from a Stream into an object of type T.
Task<object> DeserializeAsync(Stream json, Type type, JsonSerializerOptions options = null, CancellationToken cancellationToken = null)Asynchronously deserialize JSON from a Stream into an object of the specified type.

Task<object> DeserializeAsync(Stream json, Type type, JsonSerializerOptions options = null, CancellationToken cancellationToken = null) ​

csharp
Task<object> DeserializeAsync(Stream json, Type type, JsonSerializerOptions options = null, CancellationToken cancellationToken = null)

Asynchronously deserialize JSON from a Stream into an object of the specified type.

Parameters ​

NameDescription
cancellationTokenA token to cancel the asynchronous operation.
jsonA stream containing UTF-8 encoded JSON.
optionsOptional JsonSerializerOptions; if null, uses library defaults.
typeThe type to deserialize to.

Returns ​

A task that represents the asynchronous deserialize operation.

Task<T> DeserializeAsync(Stream json, JsonSerializerOptions options = null, CancellationToken cancellationToken = null) ​

csharp
Task<T> DeserializeAsync(Stream json, JsonSerializerOptions options = null, CancellationToken cancellationToken = null)

Asynchronously deserialize JSON from a Stream into an object of type T.

Type parameters ​

NameDescription
TThe type to deserialize to.

Parameters ​

NameDescription
cancellationTokenA token to cancel the asynchronous operation.
jsonA stream containing UTF-8 encoded JSON.
optionsOptional JsonSerializerOptions; if null, uses library defaults.

Returns ​

A task that represents the asynchronous deserialize operation.