Cornel
Cornel

Reputation: 4709

Serialize property even empty

How can I tell to the XmlSerializer to serialize a string property that is empty?

        [XmlElement("description")]
        public string Description
        {
            get;
            set;
        }

Upvotes: 0

Views: 362

Answers (1)

user57508
user57508

Reputation:

i did not try it, but "IsNullable" of XmlElementAttribute maybe helps with strings

Upvotes: 1

Related Questions