<PackageReference Include="Castle.Core" Version="4.0.0-beta002" />

IInvocation

public interface IInvocation
Encapsulates an invocation of a proxied method.
object[] Arguments { get; }

Gets the arguments that the Method has been invoked with.

Gets the generic arguments of the method.

object InvocationTarget { get; }

Gets the object on which the invocation is performed. This is different from proxy object because most of the time this will be the proxy target object.

MethodInfo Method { get; }

Gets the MethodInfo representing the method being invoked on the proxy.

For interface proxies, this will point to the MethodInfo on the target class.

object Proxy { get; }

Gets the proxy object on which the intercepted method is invoked.

object ReturnValue { get; set; }

Gets or sets the return value of the method.

Type TargetType { get; }

Gets the type of the target object for the intercepted method.

object GetArgumentValue(int index)

Gets the value of the argument at the specified index.

Returns the concrete instantiation of the Method on the proxy, with any generic parameters bound to real types.

Returns the concrete instantiation of MethodInvocationTarget, with any generic parameters bound to real types. For interface proxies, this will point to the MethodInfo on the target class.

void Proceed()

Proceeds the call to the next interceptor in line, and ultimately to the target method.

void SetArgumentValue(int index, object value)

Overrides the value of an argument at the given index with the new value provided.