Nó được nêu trong documentation mà bạn nên luôn luôn làm cho máy bay đánh chặn thoáng qua. Nếu tôi có mã mẫu này;Castle Windsor - Phát hành Interceptor với lối sống thoáng qua
//register interceptor
container.Register(Classes.FromAssemblyNamed("Sample.Interceptors")
.BasedOn<Castle.DynamicProxy.IInterceptor>()
.LifestyleTransient());
//Configure components to intercept
container.Register(Classes.FromAssemblyNamed("Sample.Component")
.IncludeNonPublicTypes().InNamespace("Sample.Component", true)
.Configure(c=>
c.Interceptors(InterceptorReference.ForType<SampleInterceptor>())
.Anywhere.LifestyleSingleton())
.WithService.DefaultInterfaces()
);
Tôi có nên lo lắng về việc phát hành SampleInterceptor
, hoặc nó sẽ được phát hành tự động sau khi dịch vụ trong Sample.Component
đã được phát hành bởi các container?
tôi đã có một cảm giác tốt rằng đây sẽ là hành vi của interceptor thoáng qua, nhưng nó không được mô tả rõ ràng trong tài liệu. Cảm ơn nhiều! – soya
Hãy cập nhật tài liệu để làm rõ hơn :) Đây là một wiki mở –