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

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -