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
StreamThe stream from which the object is deserialized.
cancellationToken
CancellationTokenA 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
TThe object to serialize.
stream
StreamThe stream to which the object is serialized.
cancellationToken
CancellationTokenA token to monitor for cancellation requests.