Table of Contents

Class CommandContext

Namespace
Cratis.Applications.Commands
Assembly
Cratis.Applications.dll

Represents the context for a command being executed.

[Authorize(Roles = "Administrator")]
public record CommandContext : IEquatable<CommandContext>
Inheritance
CommandContext
Implements
Inherited Members
Extension Methods

Constructors

CommandContext(CorrelationId, Type, object, IEnumerable<object>, CommandContextValues, object?)

Represents the context for a command being executed.

public CommandContext(CorrelationId CorrelationId, Type Type, object Command, IEnumerable<object> Dependencies, CommandContextValues Values, object? Response = null)

Parameters

CorrelationId CorrelationId

The correlation ID for the command.

Type Type

The type of the command.

Command object

The command instance.

Dependencies IEnumerable<object>

The dependencies required to handle the command.

Values CommandContextValues

A set of values associated with the command context.

Response object

The optional response from handling the command, if any.

Properties

Command

The command instance.

public object Command { get; init; }

Property Value

object

CorrelationId

The correlation ID for the command.

public CorrelationId CorrelationId { get; init; }

Property Value

CorrelationId

Dependencies

The dependencies required to handle the command.

public IEnumerable<object> Dependencies { get; init; }

Property Value

IEnumerable<object>

Response

The optional response from handling the command, if any.

public object? Response { get; init; }

Property Value

object

Type

The type of the command.

public Type Type { get; init; }

Property Value

Type

Values

A set of values associated with the command context.

public CommandContextValues Values { get; init; }

Property Value

CommandContextValues