我希望拦截器按特定顺序执行,并使用 InterceptorAttribute 将它们绑定(bind)到类:
[Interceptor(typeof(type1))]
[Interceptor(typeof(type2))]
[Interceptor(typeof(type3))]
public class SomeClass {}
但不幸的是,看起来 caSTLe 并没有运行 type1 拦截器,然后运行 type2 和 type3,而是以其他顺序运行它们。我如何强制执行特定订单?可能吗?
[更新]
我尝试使用配置文件 - 它似乎有效,但我更喜欢一个属性,看起来更容易。
最佳答案
通过属性应用的拦截器的排序是不确定的。
推荐的方式是use the registration API .
关于caSTLe-windsor - 温莎城堡拦截机 - 订单?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15556593/