Initializes a new instance of the MiddlewareContext class.
public MiddlewareContext(Func<InvocationContext, Task> next, CancellationToken cancellationToken, MiddlewareItems? items = null)
The delegate to invoke the next middleware or terminal.
The cancellation token for this step.
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.