Serializer

Ecng.Serialization

Provides an abstract base class for type-specific serializers.

Implementa: ISerializer<T>, ISerializer

Propiedades

FileExtension
public abstract string FileExtension { get; }
value = serializer.FileExtension

Gets the file extension associated with this serializer.

Métodos

DeserializeAsync
public abstract ValueTask<T> DeserializeAsync(Stream stream, CancellationToken cancellationToken)
result = serializer.DeserializeAsync(stream, cancellationToken)

Deserializes an object graph from the provided stream asynchronously.

stream
The stream from which the object graph is deserialized.
cancellationToken
A token that can be used to cancel the deserialization operation.

Devuelve: A task that represents the asynchronous deserialize operation. The task result contains the deserialized object graph.

Ecng#Serialization#ISerializer#DeserializeAsync(Stream, CancellationToken)

Non-generic implementation of the deserialize method.

stream
The stream from which the object graph is deserialized.
cancellationToken
A token that can be used to cancel the deserialization operation.

Devuelve: A task that represents the asynchronous deserialize operation. The task result contains the deserialized object graph.

Ecng#Serialization#ISerializer#SerializeAsync(object, Stream, CancellationToken)

Non-generic implementation of the serialize method.

graph
The object graph to serialize.
stream
The stream to which the graph is serialized.
cancellationToken
A token that can be used to cancel the serialization operation.

Devuelve: A task representing the asynchronous serialize operation.

SerializeAsync
public abstract ValueTask SerializeAsync(T graph, Stream stream, CancellationToken cancellationToken)
result = serializer.SerializeAsync(graph, stream, cancellationToken)

Serializes the specified object graph to the provided stream asynchronously.

graph
The object graph to serialize.
stream
The stream to which the graph is serialized.
cancellationToken
A token that can be used to cancel the serialization operation.

Devuelve: A task representing the asynchronous serialize operation.