# RequestBase Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.requestbase/)

## AddInvokeMethodOptions(InvokeMethodOptions) {#addinvokemethodoptions-orleans-codegeneration-invokemethodoptions-c1049ac6}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.requestbase/methods/addinvokemethodoptions-orleans-codegeneration-invokemethodoptions-c1049ac6/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/Runtime/GrainReference.cs#L558-L559)

```csharp
public void AddInvokeMethodOptions(InvokeMethodOptions options)
```

Incorporates the provided invocation options.

### Parameters

- `options` (`InvokeMethodOptions`): The options.

## Dispose {#dispose-dc7cad28}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.requestbase/methods/dispose-dc7cad28/)

```csharp
public abstract void Dispose()
```

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

## GetActivityName {#getactivityname-10699cc0}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.requestbase/methods/getactivityname-10699cc0/)

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

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

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

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.requestbase/methods/getargument-int-d2cf9f1d/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/Runtime/GrainReference.cs#L571)

```csharp
public virtual 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-a9b994d5}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.requestbase/methods/getargumentcount-a9b994d5/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/Runtime/GrainReference.cs#L548)

```csharp
public virtual int GetArgumentCount()
```

Gets the number of arguments.

## GetCancellationToken {#getcancellationtoken-ed4cde98}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.requestbase/methods/getcancellationtoken-ed4cde98/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/Runtime/GrainReference.cs#L602)

```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-ce140a71}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.requestbase/methods/getdefaultresponsetimeout-ce140a71/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/Runtime/GrainReference.cs#L598)

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

Gets the default response timeout.

## GetInterfaceName {#getinterfacename-778a4894}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.requestbase/methods/getinterfacename-778a4894/)

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

Gets the full interface name.

## GetInterfaceType {#getinterfacetype-20f91064}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.requestbase/methods/getinterfacetype-20f91064/)

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

Gets the interface type.

## GetMethod {#getmethod-1c374a5f}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.requestbase/methods/getmethod-1c374a5f/)

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

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

## GetMethodName {#getmethodname-375a3d8c}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.requestbase/methods/getmethodname-375a3d8c/)

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

Gets the method name.

## GetTarget {#gettarget-e728a485}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.requestbase/methods/gettarget-e728a485/)

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

Gets the invocation target.

### Returns

The invocation target.

## Invoke {#invoke-313b7932}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.requestbase/methods/invoke-313b7932/)

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

Invoke the object.

## SetArgument(int, object) {#setargument-int-object-3bfa0840}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.requestbase/methods/setargument-int-object-3bfa0840/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/Runtime/GrainReference.cs#L574)

```csharp
public virtual 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-4a731d8e}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.requestbase/methods/settarget-orleans-serialization-invocation-itargetholder-4a731d8e/)

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

## ToString {#tostring-10f80232}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.requestbase/methods/tostring-10f80232/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/Runtime/GrainReference.cs#L595)

```csharp
public override string ToString()
```

Returns a string that represents the current object.

### Returns

A string that represents the current object.

## TryCancel {#trycancel-bca92fd7}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.requestbase/methods/trycancel-bca92fd7/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/Runtime/GrainReference.cs#L600)

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

Tries to cancel the invocation.

### Returns

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