Can attributes be added dynamically in C#?

后端 未结 10 969
别跟我提以往
别跟我提以往 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:41

    You can't. One workaround might be to generate a derived class at runtime and adding the attribute, although this is probably bit of an overkill.

提交回复
热议问题