Skip to content

ReplExecutionContext

Provides execution context for middleware and handlers.

public sealed class ReplExecutionContext

ReplExecutionContext(IServiceProvider, CancellationToken)

Section titled “ReplExecutionContext(IServiceProvider, CancellationToken)”

Initializes a new instance of the ReplExecutionContext class.

public ReplExecutionContext(IServiceProvider services, CancellationToken cancellationToken = default)

Gets the cancellation token for the current execution.

public CancellationToken CancellationToken { get; }

CancellationToken

Gets a mutable item bag for middleware communication.

public IDictionary<string, object?> Items { get; }

IDictionary<string, object>

Gets or sets the handler’s return value. Populated once the pipeline reaches the handler, so a middleware can inspect or replace it after awaiting ReplNext; a middleware that short-circuits may set it to supply the result that is rendered and classified instead.

public object? Result { get; set; }

object

Gets the service provider for the current execution.

public IServiceProvider Services { get; }

IServiceProvider