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