AdvantageCMS.Core.Common.BaseClasses Namespace
Build With Advantage

ObjectDataContractXMLSerializer<(Of <(<'T>)>)>..::..SaveToString Method

Serializes the specified object to an XML string using DataContractSerializer.

Namespace:  AdvantageCMS.Core.Utils
Assembly:  AdvantageCMS.Core (in AdvantageCMS.Core.dll)

Syntax


public static string SaveToString(
	T objectToSerialize
)

Parameters

objectToSerialize
Type: T
The object to serialize.

Return Value

The XML string representation of the object.

Examples


C#
var profile = new UserProfile { Name = "Alice", Age = 30 };
string xml = ObjectDataContractXMLSerializer<UserProfile>.SaveToString(profile);
// xml contains indented DataContract XML representation