views:

70

answers:

1

I have many virtual methods in a class, but only one should be intercepted, Can I tell Castle Windsor to override only that method so I dont have to do validation in the Intercept method?

Edit:

I use the IKernelEvents.ComponentRegistered event to choose which types get the interceptor.

A: 
  1. If you want to proxy just one method, use IProxyHook to pick which method you want to proxy.
  2. If you're modifying ComponentModel (and adding interceptors or proxy hooks is one such operation) use IContributeComponentModelConstructions for that. See the docs for more in depth explanation.
Krzysztof Koźmic
Should I use this interface to change the 'ComponentModel.Implementation' for a proxy I created manually using DynamicProxy API with IProxyHook?
Thiado de Arruda
As the docs say, generally if you want to do modifications to ComponentModel do it in `IContributeComponentModelConstruction`
Krzysztof Koźmic