caSTLe-windsor - 温莎城堡拦截机 - 订单?

标签 castle-windsor

我希望拦截器按特定顺序执行,并使用 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/

相关文章:

entity-framework - 每个请求的 Windsor 和 DbContext - DbContext 已被处理

.net - 构造函数注入(inject)替代方案(温莎城堡)

c# - CaSTLe Windsor自动注册多个接口(interface)及其对应的实现

c# - ILogger 的 CaSTLe Windsor Visual Studio 代码片段

c# - 如何延长 SolrConnection 中的超时? (SolrConnection异常: The operation has timed out)

c# - 线程化 Windows 服务 - SmtpClient 问题

c# - CaSTLe Windsor 生活方式取决于构造函数参数

dependency-injection - 我需要哪些程序集才能开始在我的应用程序中使用 CaSTLe Windsor?

asp.net - 如何注册通用存储库的依赖?

c# - CaSTLe Windsor - 使用工厂方法注册所有接口(interface)