Search code examples
.netinversion-of-controlcastle-windsorcastlecastle-dynamicproxy

Castle Windsor DynamicProxy Interception IInvocation Documentation


On a Castle Castle.DynamicProxy.IInvocation, what's the difference between

GetConcreteMethod

GetConcreteMethodInvocationTarget

Method

I read the documentation, but I don't understand the difference, especially between the first two.

I'm guessing that Method is just the MethodInfo for the method on the actual registered type?


Solution

    • GetConcreteMethod returns a closed method on the proxy, closing it in case it has generic parameters. If it is not a generic method it will plainly return the same value as the Method property.

    • GetConcreteMethodInvocationTarget returns the same value as the MethodInvocationTarget property, but in debug builds asserts that it returns a closed method definition.

    • Method returns the MethodInfo of the proxy, not bothering to return a closed generic method.

    Does this answer you question?

    By the way, I've updated the Xml docs so hopefully they will be a bit more clear.