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