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
CorrelationIdCorrelationIdThe correlation ID for the command.
TypeTypeThe type of the command.
CommandobjectThe command instance.
DependenciesIEnumerable<object>The dependencies required to handle the command.
ValuesCommandContextValuesA set of values associated with the command context.
ResponseobjectThe optional response from handling the command, if any.
Properties
Command
The command instance.
public object Command { get; init; }
Property Value
CorrelationId
The correlation ID for the command.
public CorrelationId CorrelationId { get; init; }
Property Value
Dependencies
The dependencies required to handle the command.
public IEnumerable<object> Dependencies { get; init; }
Property Value
Response
The optional response from handling the command, if any.
public object? Response { get; init; }
Property Value
Type
The type of the command.
public Type Type { get; init; }
Property Value
Values
A set of values associated with the command context.
public CommandContextValues Values { get; init; }