MapNexusOperation(IEndpointRouteBuilder, string, Delegate)
staticextension
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
serviceIEndpointRouteBuilder- The group which
NexusEndpointRouteBuilderExtensionsreturns. operationstring- The operation name, such as
charge, of URL-unreserved characters. handlerDelegate- 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 aSystem.Threading.Tasks.TaskorSystem.Threading.Tasks.ValueTask. 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.ArgumentExceptionoperationis empty or has characters other than URL-unreserved ones, orhandlerdoesn't return durable work.
