1
container
.Register
(
AllTypes
.FromAssemblyContaining<TestInterceptor>()
.BasedOn<IInterceptor>()
.Where(t => t.Name.EndsWith("Interceptor"))
.WithService.AllInterfaces()
.Configure(c => c.LifeStyle.Transient),
Component
.For<IRepository>()
.ImplementedBy<LogRepository>()
.Interceptors
(
InterceptorReference.ForType<TestInterceptor>(),
InterceptorReference.ForType<TestTwoInterceptor>(),
InterceptorReference.ForType<TestThreeInterceptor>()
).Anywhere
);
是否有一种简单的方法来指定组件将使用所有拦截器而不是必须指定每个拦截器?Castle Windsor - 指定所有拦截器