Programmatically set properties to exclude from serialization

前端 未结 7 1202
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-30 07:19

Is it possible to programmatically set that you want to exclude a property from serialization?

Example:

  • When de-serializing, I want to load up an ID fi
7条回答
  •  清歌不尽
    2020-12-30 07:29

    If you're using XML serialization, use the [XmlIgnore] attribute. Otherwise, how to ignore a particular property is defined by the serializer itself.

提交回复
热议问题