Skip to content

IInvokable Methods

Represents an object which can be invoked asynchronously.

GetActivityName

abstract
public abstract string GetActivityName()
Gets the activity name, which refers to both the interface name and method name.

GetArgument(int)

abstract
public abstract object? GetArgument(int index)
Gets the argument at the specified index.

Parameters

indexint
The argument index.

Returns

The argument at the specified index.

GetArgumentCount

abstract
public abstract int GetArgumentCount()
Gets the number of arguments.

GetCancellationToken

virtual
View source
public virtual CancellationToken GetCancellationToken()
Gets the cancellation token for this request. If the request does not accept a cancellation token, this will be System.Threading.CancellationToken.None.

Returns

The cancellation token for this request.

GetInterfaceName

abstract
public abstract string GetInterfaceName()
Gets the full interface name.

GetInterfaceType

abstract
public abstract Type GetInterfaceType()
Gets the interface type.

GetMethod

abstract
public abstract MethodInfo GetMethod()
Gets the method info object, which may be null.

GetMethodName

abstract
public abstract string GetMethodName()
Gets the method name.

GetTarget

abstract
public abstract object? GetTarget()
Gets the invocation target.

Returns

The invocation target.

Invoke

abstract
public abstract ValueTask<Response> Invoke()
Invoke the object.

SetArgument(int, object)

abstract
public abstract void SetArgument(int index, object value)
Sets the argument at the specified index.

Parameters

indexint
The argument index.
valueobject
The argument value

SetTarget(ITargetHolder)

abstract
public abstract void SetTarget(ITargetHolder holder)
Sets the invocation target from an instance of ITargetHolder.

Parameters

holderITargetHolder
The invocation target.

TryCancel

virtual
View source
public virtual bool TryCancel()
Tries to cancel the invocation.

Returns

true if cancellation was requested, otherwise false.