views:

24

answers:

1

Hi All

When I assign an interceptor to the component when registering it (interface based), every method that is part of the interface contract gets intercepted. Is there a way prevent a method from being intercepted an attribute or something?

Thanks

A: 

DP uses IProxyGenerationHooks to decide which method should be intercepted.

You can come up with your own attribute type and decorate your methods with it, and have a hook that will act accordingly based on the attribute. Or not use attributes at all and have some other logic to decide whether or not to intercept a method. It's up to you. DP won't constrain you here.

Krzysztof Koźmic
I came across this article of your on Selecting which methods tointercept which shows an implementation of ProxyGenerationOptions withProxyGenerationHook. I am using windsor container and register typesas followIWindsorContainer container = new WindsorContainer();container.Register(Component.For<IFoo>().ImplementedBy<Foo>());could you please indicate how can i register ProxyGenerationOptions using windsor container. Thanks
joblot

related questions