开发者

Serialize property even empty

开发者 https://www.devze.com 2022-12-11 06:36 出处:网络
How can I tell to the XmlSerializer to serialize a string property that is empty? [XmlElement(\"de开发者_开发技巧scription\")]

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

        [XmlElement("de开发者_开发技巧scription")]
        public string Description
        {
            get;
            set;
        }


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

0

精彩评论

暂无评论...
验证码 换一张
取 消