Interface ISerializer
Base contract for serializers.
Namespace: Kephas.Serialization
Assembly: Kephas.Core.dll
Syntax
public interface ISerializerMethods
| Improve this Doc View SourceDeserializeAsync(TextReader, ISerializationContext, CancellationToken)
Deserializes an object asynchronously.
Declaration
Task<object> DeserializeAsync(TextReader textReader, ISerializationContext context = null, CancellationToken cancellationToken = default(CancellationToken))Parameters
| Type | Name | Description | 
|---|---|---|
| System.IO.TextReader | textReader | The System.IO.TextReader containing the serialized object. | 
| ISerializationContext | context | The context. | 
| System.Threading.CancellationToken | cancellationToken | The cancellation token. | 
Returns
| Type | Description | 
|---|---|
| System.Threading.Tasks.Task<System.Object> | A Task promising the deserialized object. | 
SerializeAsync(Object, TextWriter, ISerializationContext, CancellationToken)
Serializes the provided object asynchronously.
Declaration
Task SerializeAsync(object obj, TextWriter textWriter, ISerializationContext context = null, CancellationToken cancellationToken = default(CancellationToken))Parameters
| Type | Name | Description | 
|---|---|---|
| System.Object | obj | The object. | 
| System.IO.TextWriter | textWriter | The System.IO.TextWriter used to write the object content. | 
| ISerializationContext | context | The context. | 
| System.Threading.CancellationToken | cancellationToken | The cancellation token. | 
Returns
| Type | Description | 
|---|---|
| System.Threading.Tasks.Task | A Task promising the serialized object as a string. |