MiddlewareContext(Func<InvocationContext, Task>, CancellationToken, MiddlewareItems?) Constructor

Definition

Assembly CliInvoke.Core.dll

Initializes a new instance of the MiddlewareContext class.

public MiddlewareContext(Func<InvocationContext, Task> next, CancellationToken cancellationToken, MiddlewareItems? items = null)

Parameters

next
Func<InvocationContext, Task>

The delegate to invoke the next middleware or terminal.

cancellationToken
CancellationToken

The cancellation token for this step.

items
MiddlewareItems

Optional pre-seeded items. When provided, the context shares this instance so values injected before the chain runs (e.g. a logger) are visible to every middleware. When omitted, a fresh MiddlewareItems is created.