Table of Contents

Interface ISerializer<T>

Namespace
Ecng.Serialization
Assembly
Ecng.Serialization.dll

Provides methods for serializing and deserializing objects of type T.

public interface ISerializer<T> : ISerializer

Type Parameters

T

The type of the object graph to serialize and deserialize.

Inherited Members
Extension Methods

Methods

DeserializeAsync(Stream, CancellationToken)

Asynchronously deserializes an object of type T from the provided stream.

ValueTask<T> DeserializeAsync(Stream stream, CancellationToken cancellationToken)

Parameters

stream Stream

The stream from which the object is deserialized.

cancellationToken CancellationToken

A token to monitor for cancellation requests.

Returns

ValueTask<T>

A ValueTask<TResult> representing the asynchronous operation and the deserialized object.

SerializeAsync(T, Stream, CancellationToken)

Asynchronously serializes the specified object of type T into the provided stream.

ValueTask SerializeAsync(T graph, Stream stream, CancellationToken cancellationToken)

Parameters

graph T

The object to serialize.

stream Stream

The stream to which the object is serialized.

cancellationToken CancellationToken

A token to monitor for cancellation requests.

Returns

ValueTask

A ValueTask representing the asynchronous operation.