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 - 指定所有攔截器