Class XmlSerializer
An XML serializer based on the ServiceStack infrastructure.
Inheritance
System.Object
XmlSerializer
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Kephas.Serialization.ServiceStack.Text
Assembly: Kephas.Serialization.ServiceStack.Text.dll
Syntax
[OverridePriority(Priority.Low)]
public class XmlSerializer : ISerializer<XmlMediaType>, ISerializer, ISyncSerializer
Methods
| Improve this Doc View SourceDeserialize(TextReader, ISerializationContext)
Deserializes an object.
Declaration
public object Deserialize(TextReader textReader, ISerializationContext context = null)
Parameters
Type | Name | Description |
---|---|---|
System.IO.TextReader | textReader | The System.IO.TextReader containing the serialized object. |
ISerializationContext | context | The context. |
Returns
Type | Description |
---|---|
System.Object | The deserialized object. |
DeserializeAsync(TextReader, ISerializationContext, CancellationToken)
Deserialize an object asynchronously.
Declaration
public 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. |
Serialize(Object, TextWriter, ISerializationContext)
Serializes the provided object.
Declaration
public void Serialize(object obj, TextWriter textWriter, ISerializationContext context = null)
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. |
SerializeAsync(Object, TextWriter, ISerializationContext, CancellationToken)
Serializes the provided object asynchronously.
Declaration
public 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. |