Can I add attributes to an object property at runtime?

后端 未结 2 1278
一向
一向 2020-12-09 12:19

For example I want to remove or change below property attributes or add a new one. Is it possible?

[XmlElement(\"bill_info\")]
[XmlIgnore]
public BillInfo Bi         


        
2条回答
  •  自闭症患者
    2020-12-09 12:30

    It is not possible to add/remove attributes from a class at runtime.

    It is possible however to update the way XML serialization works at runtime without needing to edit attributes. See Marc's post.

    EDIT Updated

提交回复
热议问题