Can attributes be added dynamically in C#?

后端 未结 10 970
别跟我提以往
别跟我提以往 2020-11-22 14:32

Is it possible to add attributes at runtime or to change the value of an attribute at runtime?

10条回答
  •  再見小時候
    2020-11-22 14:56

    Why do you need to? Attributes give extra information for reflection, but if you externally know which properties you want you don't need them.

    You could store meta data externally relatively easily in a database or resource file.

提交回复
热议问题