Click or drag to resize

HelperAddXMLElementDataClass Method (XmlDocument, Object, String, Boolean)

Create a XML node with XML elements from DataClass items and value from pDataItem. This added to XML document as XML node by name from parameter pAddToNode.

Namespace:  SOWIData.XML
Assembly:  SOWIData.XML (in SOWIData.XML.dll) Version: 19.1.23.1 (19.1.23.622)
Syntax
public static XmlDocument AddXMLElement<DataClass>(
	this XmlDocument pXMLDocument,
	Object pDataItem,
	string pAddToNode = "",
	bool pCleanFields = false
)

Parameters

pXMLDocument
Type: System.XmlXmlDocument
Exist XML document
pDataItem
Type: SystemObject
Data item object
pAddToNode (Optional)
Type: SystemString
Add to node. Details see AddXMLElement(XmlDocument, XmlElement, String)
pCleanFields (Optional)
Type: SystemBoolean
Reads fields without Entity Framework objects and fields of NotMapped attribute. Details see method GetFieldsDataClass.

Type Parameters

DataClass
Data class or interface defined which fields to read

Return Value

Type: XmlDocument

[Missing <returns> documentation for "M:SOWIData.XML.Helper.AddXMLElement``1(System.Xml.XmlDocument,System.Object,System.String,System.Boolean)"]

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type XmlDocument. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks
XML value exceptions handling see ValueExceptions. Exception string prefix letter as # and store as element value.
Examples
This example added a XML node with elements from easyPlanData.Interface.IObjekt (is a type of interface). With values from data item pDataItem parameter
var lXMLDocument = new System.Xml.XmlDocument();
lXMLDocument.AddXMLElement<easyPlanData.Interface.IObjekt>(pDataItem);
See Also