Interface IDataContractSerializerService<T>
- Namespace
- CMS.DataEngine
- Assembly
- CMS.DataEngine.dll
Interface for service serializing / deserializing objects from / to XML using System.Runtime.Serialization.DataContractSerializer.
public interface IDataContractSerializerService<T>
Type Parameters
TType of object to serialize / deserialize.
- Extension Methods
Methods
Deserialize(string)
Deserializes XML string to object instance.
T Deserialize(string xml)
Parameters
xmlstringInput XML text for deserialization.
Returns
- T
Deserialized object instance from
xmlstring representation.
Exceptions
- ArgumentNullException
Thrown when
xmlisnull.- SerializationException
Thrown when deserialization from input
xmlfailed.
Serialize(T, XmlWriterSettings)
Serializes object instance to XML string representation.
string Serialize(T obj, XmlWriterSettings settings = null)
Parameters
objTInput object for serialization.
settingsXmlWriterSettingsSettings used for System.Xml.XmlWriter. If this is
null, default settings are used.
Returns
- string
Serialized object
objto XML string representation.
Exceptions
- ArgumentNullException
Thrown when
objisnull.