# DurableTask.RunInline(string, Action)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.durabletask/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.durabletask/methods/)

[Source](https://github.com/dotnet/orleans/blob/6a0e937f544c35ffcf11b37e4c2b7de5a1580a03/src/Orleans.Durable.Abstractions/DurableTask.RunInline.cs)

```csharp
public static void RunInline(string name, Action effect)
```

Runs `effect` in the caller's current work item before returning, and records its outcome; later runs of the task's body don't run it again.

### Parameters

- `name` (`string`): The effect's name within the running task. A name repeated in one run identifies the effect's later occurrences by their order. Names don't contain `$`.
- `effect` (`Action`): The synchronous effect.

### Exceptions

- `System.ArgumentNullException`: `name` or `effect` is `null`.
- `System.ArgumentException`: `name` is empty or contains `$`.
- `System.InvalidOperationException`: The host can't record the effect from the calling code, for example after `ConfigureAwait(false)`.
- `Orleans.Durable.Tasks.DurableTaskAttemptCanceledException`: The host canceled the attempt, for example with [DurableTaskAttemptCancellationReason](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.durabletaskattemptcancellationreason/) because an earlier run recorded another kind of operation, such as a step, under the effect's identifier.
- `System.NotSupportedException`: The host doesn't support recorded effects.
