【发布时间】:2015-04-29 20:07:46
【问题描述】:
如何将行为应用于特定命名空间中的所有接口? 我知道如何将行为应用于像 IMyBlFacade 这样的具体接口, 但我不想单独对所有接口执行此操作,而是一次性完成。
在使用自定义 IInterfaceBehaviors 时实现 ICallHandler 是否已过时? 据我了解,两者都建立了拦截管道。
使用 ootb 调用处理程序和自定义调用处理程序而不是 IInterface 行为有什么好处?
我不希望它是这样的:
unity.RegisterType<IMyService, MyService>(
new ContainerControlledLifetimeManager(),
new Interceptor<InterfaceInterceptor>(),
new InterceptionBehavior<OutputInterceptionBehavior>());
比较像这样(伪代码):
unity.addInterceptor<InterfaceInterceptor>()
.addMachingRule<namespace>("mynamespace")
.addBehaviors(...);
【问题讨论】:
标签: unity-container aop enterprise-library