# RequestContext Methods

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

## AllowCallChainReentrancy {#allowcallchainreentrancy-3721c534}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.requestcontext/methods/allowcallchainreentrancy-3721c534/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/Runtime/RequestContext.cs#L51-L53)

```csharp
public static ReentrancySection AllowCallChainReentrancy()
```

Allows reentrancy for subsequent calls issued before the returned [ReentrancySection](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.requestcontext.reentrancysection/) is disposed.

## Clear {#clear-a1680ca4}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.requestcontext/methods/clear-a1680ca4/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/Runtime/RequestContext.cs#L158-L162)

```csharp
public static void Clear()
```

Clears the current request context.

## Get(string) {#get-string-18a82a09}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.requestcontext/methods/get-string-18a82a09/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/Runtime/RequestContext.cs#L70-L78)

```csharp
public static object? Get(string key)
```

Retrieves a value from the request context.

### Parameters

- `key` (`string`): The key for the value to be retrieved.

### Returns

The value currently associated with the provided key, otherwise `null` if no data is present for that key.

## Remove(string) {#remove-string-f8b8eb31}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.requestcontext/methods/remove-string-f8b8eb31/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/Runtime/RequestContext.cs#L124-L148)

```csharp
public static bool Remove(string key)
```

Remove a value from the request context.

### Parameters

- `key` (`string`): The key for the value to be removed.

### Returns

`true` if the value was previously in the request context and has now been removed, otherwise `false`.

## Set(string, object) {#set-string-object-24d22695}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.requestcontext/methods/set-string-object-24d22695/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/Runtime/RequestContext.cs#L88-L115)

```csharp
public static void Set(string key, object value)
```

Sets a value in the request context.

### Parameters

- `key` (`string`): The key for the value to be updated or added.
- `value` (`object`): The value to be stored into the request context.

## SuppressCallChainReentrancy {#suppresscallchainreentrancy-7152745e}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.requestcontext/methods/suppresscallchainreentrancy-7152745e/)

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

```csharp
public static ReentrancySection SuppressCallChainReentrancy()
```

Suppresses reentrancy for subsequent calls issued before the returned [ReentrancySection](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.requestcontext.reentrancysection/) is disposed.
