开发者

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>())
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜