c# - How to insert comment in xml generated by serializer? -
this question has answer here:
i have class, example:
public class myclass public property myproperty integer = 1 end class
serializer (xml.serialization.xmlserializer) creates xml:
<?xml version="1.0" encoding="utf-8"?> <myclass xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema"> <myproperty>1</myproperty> </myclass>
how can serializer somthing this:
<?xml version="1.0" encoding="utf-8"?> <myclass xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema"> <!-- use positive values less 10 --> <myproperty>1</myproperty> </myclass>
thanks!
try make use of [xmlcomment(value = "your comment")] attribute
Comments
Post a Comment