# IInvokable Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.invocation.iinvokable/)

## GetActivityName {#getactivityname-ebf833ce}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.invocation.iinvokable/methods/getactivityname-ebf833ce/)

```csharp
public abstract string GetActivityName()
```

Gets the activity name, which refers to both the interface name and method name.

## GetArgument(int) {#getargument-int-72629169}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.invocation.iinvokable/methods/getargument-int-72629169/)

```csharp
public abstract object? GetArgument(int index)
```

Gets the argument at the specified index.

### Parameters

- `index` (`int`): The argument index.

### Returns

The argument at the specified index.

## GetArgumentCount {#getargumentcount-0e595acc}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.invocation.iinvokable/methods/getargumentcount-0e595acc/)

```csharp
public abstract int GetArgumentCount()
```

Gets the number of arguments.

## GetCancellationToken {#getcancellationtoken-39f6d5fe}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.invocation.iinvokable/methods/getcancellationtoken-39f6d5fe/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Invocation/IInvokable.cs#L83)

```csharp
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.

## GetDefaultResponseTimeout {#getdefaultresponsetimeout-3acd68e7}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.invocation.iinvokable/methods/getdefaultresponsetimeout-3acd68e7/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Invocation/IInvokable.cs#L77)

```csharp
public virtual TimeSpan? GetDefaultResponseTimeout()
```

Gets the default response timeout.

## GetInterfaceName {#getinterfacename-8db13fa6}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.invocation.iinvokable/methods/getinterfacename-8db13fa6/)

```csharp
public abstract string GetInterfaceName()
```

Gets the full interface name.

## GetInterfaceType {#getinterfacetype-485f0ba4}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.invocation.iinvokable/methods/getinterfacetype-485f0ba4/)

```csharp
public abstract Type GetInterfaceType()
```

Gets the interface type.

## GetMethod {#getmethod-c20fed3d}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.invocation.iinvokable/methods/getmethod-c20fed3d/)

```csharp
public abstract MethodInfo GetMethod()
```

Gets the method info object, which may be `null`.

## GetMethodName {#getmethodname-8c2ae2e6}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.invocation.iinvokable/methods/getmethodname-8c2ae2e6/)

```csharp
public abstract string GetMethodName()
```

Gets the method name.

## GetTarget {#gettarget-0eeccce2}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.invocation.iinvokable/methods/gettarget-0eeccce2/)

```csharp
public abstract object? GetTarget()
```

Gets the invocation target.

### Returns

The invocation target.

## Invoke {#invoke-69e7de34}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.invocation.iinvokable/methods/invoke-69e7de34/)

```csharp
public abstract ValueTask<Response> Invoke()
```

Invoke the object.

## SetArgument(int, object) {#setargument-int-object-cd8ac7d1}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.invocation.iinvokable/methods/setargument-int-object-cd8ac7d1/)

```csharp
public abstract void SetArgument(int index, object value)
```

Sets the argument at the specified index.

### Parameters

- `index` (`int`): The argument index.
- `value` (`object`): The argument value

## SetTarget(ITargetHolder) {#settarget-orleans-serialization-invocation-itargetholder-63e0e1ee}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.invocation.iinvokable/methods/settarget-orleans-serialization-invocation-itargetholder-63e0e1ee/)

```csharp
public abstract void SetTarget(ITargetHolder holder)
```

Sets the invocation target from an instance of [ITargetHolder](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.invocation.itargetholder/).

### Parameters

- `holder` (`ITargetHolder`): The invocation target.

## TryCancel {#trycancel-42eceaad}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.invocation.iinvokable/methods/trycancel-42eceaad/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Invocation/IInvokable.cs#L90)

```csharp
public virtual bool TryCancel()
```

Tries to cancel the invocation.

### Returns

`true` if cancellation was requested, otherwise `false`.
