Class XmlSerializer
Provides XML serialization and deserialization using System.Xml.Serialization.
Implements
Inherited Members
Namespace: Innovt.Core.Serialization
Assembly: Innovt.Core.dll
Syntax
public class XmlSerializer : ISerializer
Methods
| Edit this page View SourceDeserializeObject<T>(string)
Deserializes an XML string into an object of type T
.
Declaration
public T DeserializeObject<T>(string serializedObject)
Parameters
Type | Name | Description |
---|---|---|
string | serializedObject | The XML string to deserialize. |
Returns
Type | Description |
---|---|
T | The deserialized object of type |
Type Parameters
Name | Description |
---|---|
T | The type of object to deserialize. |
SerializeObject<T>(T)
Serializes an object of type T
into an XML string.
Declaration
public string SerializeObject<T>(T obj)
Parameters
Type | Name | Description |
---|---|---|
T | obj | The object to serialize. |
Returns
Type | Description |
---|---|
string | The serialized object as an XML string. |
Type Parameters
Name | Description |
---|---|
T | The type of object to serialize. |
SerializeObject<T>(T, Dictionary<string, string>)
Serializes an object of type T
into an XML string with optional namespaces.
Declaration
public string SerializeObject<T>(T obj, Dictionary<string, string> namespaces)
Parameters
Type | Name | Description |
---|---|---|
T | obj | The object to serialize. |
Dictionary<string, string> | namespaces | A dictionary of namespaces to include in the XML serialization. |
Returns
Type | Description |
---|---|
string | The serialized object as an XML string. |
Type Parameters
Name | Description |
---|---|
T | The type of object to serialize. |
Exceptions
Type | Condition |
---|---|
Exception | Thrown when there is an XML serialization error. |