Herman
Herman

Reputation: 3024

Castle Windsor Interceptor for private/protected method

Is it true that in order for castle windsor's interceptor to intercept a method, that method needs to be declare public?

Upvotes: 2

Views: 2028

Answers (1)

Krzysztof Kozmic
Krzysztof Kozmic

Reputation: 27374

No it is not true.

The method must be accessible for generated proxy type, which means it must be virtual (or interface method) and it must not be private.

So protected and protected internal methods are good to go. Also internal methods from assembly visible to generated dynamic proxy assembly are OK.

Upvotes: 8

Related Questions