Does the order of attributes have any guarantees?

前端 未结 3 695
情歌与酒
情歌与酒 2020-12-20 11:56

If multiple attributes are applied to a member, e.g.

[Foo]
[Bar]
void Baz() { ... }

Then are any guarantees made by the CLR/.NET specificat

3条回答
  •  暖寄归人
    2020-12-20 12:40

    imo Attributes shouldn't have an order as they're not flow control constructs.

    I guess you could add a priority property to the attribute and use that to determine the run order?

提交回复
热议问题