method selector on one of many interceptors for a service registered in Castle.Windsor
Using Castle.Windsor, how would I go about adding a IProxyGenerationHook or selector for one of several interceptors defined for a specific service. For example consider the following component registration:
container.Register( _
开发者_开发技巧 Component.For(Of IDataLoader) _
.ImplementedBy(Of sqlldrDataLoader) _
.Interceptors(Of LoggingInterceptor, FancySchmancyInterceptor))
The IDataLoader service has several methods. I want the following: a) LoggingInterceptor will intercept every method. b) FancySchmancyInterceptor should only intercept a subset of methods as defined in a selector of some description.
Many thanks, Ryan.
.SelectInterceptorsWith(s => s.Service<YourSelectorComponent>())
精彩评论