How can I prevent a datamember from being serialized

后端 未结 5 1171
鱼传尺愫
鱼传尺愫 2021-01-12 16:58

I only want only to de-serializing a certain data member, without serializing it.

I understand I can set EmitDefaultValue =false, and set the value to null.

<
5条回答
  •  天涯浪人
    2021-01-12 17:44

    There is the attribute System.Xml.Serialization.XmlIgnoreAttribute wich say to xmkserializers to ignore your property. But it only change xml serialization behavior.

提交回复
热议问题