Interface ISerializer
- Namespace
- Ecng.Serialization
- Assembly
- Ecng.Serialization.dll
Provides methods for serializing and deserializing objects.
public interface ISerializer
- Extension Methods
Properties
FileExtension
Gets the file extension associated with the serialized format.
string FileExtension { get; }
Property Value
Methods
DeserializeAsync(Stream, CancellationToken)
Asynchronously deserializes an object graph from the provided stream.
ValueTask<object> DeserializeAsync(Stream stream, CancellationToken cancellationToken)
Parameters
streamStreamThe stream from which the object is deserialized.
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- ValueTask<object>
A ValueTask<TResult> representing the asynchronous operation and the deserialized object.
SerializeAsync(object, Stream, CancellationToken)
Asynchronously serializes the specified object graph into the provided stream.
ValueTask SerializeAsync(object graph, Stream stream, CancellationToken cancellationToken)
Parameters
graphobjectThe object graph to serialize.
streamStreamThe stream to which the object is serialized.
cancellationTokenCancellationTokenA token to monitor for cancellation requests.