【发布时间】:2013-04-01 08:16:23
【问题描述】:
我想让拦截器以特定的顺序执行,并以这种方式使用 InterceptorAttribute 将它们绑定到类:
[Interceptor(typeof(type1))]
[Interceptor(typeof(type2))]
[Interceptor(typeof(type3))]
public class SomeClass {}
但不幸的是,城堡似乎不是运行 type1 拦截器,然后是 type2 和 type3,而是以其他顺序运行它们。如何强制执行特定订单?有可能吗?
[更新]
我尝试了配置文件 - 它似乎工作,但我更喜欢一个属性,似乎更容易。
【问题讨论】:
-
不要使用拦截,而是尝试应用装饰器。
标签: castle-windsor