# NexusEndpointRouteBuilderExtensions.MapNexusOperation(IEndpointRouteBuilder, string, Delegate)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.durable.http/microsoft.aspnetcore.builder.nexusendpointroutebuilderextensions/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.durable.http/microsoft.aspnetcore.builder.nexusendpointroutebuilderextensions/methods/)

[Source](https://github.com/dotnet/orleans/blob/4e887e9c914a2f2647fb3c81de963511521dd9cb/src/Orleans.Durable.Http/NexusEndpointRouteBuilderExtensions.cs#L103-L147)

```csharp
public static RouteGroupBuilder MapNexusOperation(this IEndpointRouteBuilder service, string operation, Delegate handler)
```

Maps the Nexus operation `operation`, whose handler returns durable work, such as `grain.ChargeAsync(input)`, which a start request starts as an operation.

### Parameters

- `service` (`IEndpointRouteBuilder`): The group which [NexusEndpointRouteBuilderExtensions](/orleans/docs/api/csharp/microsoft.orleans.durable.http/microsoft.aspnetcore.builder.nexusendpointroutebuilderextensions/) returns.
- `operation` (`string`): The operation name, such as `charge`, of URL-unreserved characters.
- `handler` (`Delegate`): A delegate which binds the operation's input, such as from the JSON request body, and other parameters like a Minimal API handler, and returns a durable grain call or a reference to an existing task, which `grain.GetDurableTask<T>(id)` returns, directly or through a `System.Threading.Tasks.Task-1` or `System.Threading.Tasks.ValueTask-1`. It runs for each start request, including retries, and only creates the work.

### Returns

A group builder which configures the operation's start and cancel endpoints.

### Exceptions

- `System.ArgumentException`: `operation` is empty or has characters other than URL-unreserved ones, or `handler` doesn't return durable work.
