Class AggregateRootMutation
- Namespace
- Cratis.Chronicle.Aggregates
- Assembly
- Cratis.Chronicle.dll
Represents an implementation of IAggregateRootMutation.
public class AggregateRootMutation : IAggregateRootMutation
- Inheritance
-
AggregateRootMutation
- Implements
- Inherited Members
Constructors
AggregateRootMutation(IAggregateRootContext, IAggregateRootMutator, IEventSequence)
Represents an implementation of IAggregateRootMutation.
public AggregateRootMutation(IAggregateRootContext aggregateRootContext, IAggregateRootMutator mutator, IEventSequence eventSequence)
Parameters
aggregateRootContext
IAggregateRootContextThe IAggregateRootContext for the aggregate root.
mutator
IAggregateRootMutatorThe IAggregateRootMutator for the aggregate root.
eventSequence
IEventSequenceThe IEventSequence for the aggregate root.
Fields
AggregateRootCausationTypeProperty
The causation aggregate root type property.
public const string AggregateRootCausationTypeProperty = "aggregateRootType"
Field Value
CausationEventSequenceIdProperty
The event sequence id causation property.
public const string CausationEventSequenceIdProperty = "eventSequenceId"
Field Value
CausationType
The causation type for the aggregate root.
public static readonly CausationType CausationType
Field Value
Properties
EventSourceId
Gets the EventSourceId for the aggregate root.
public EventSourceId EventSourceId { get; }
Property Value
HasEvents
Gets a value indicating whether the mutation has events. This is an indication of whether or not the aggregate root has been mutated.
public bool HasEvents { get; }
Property Value
Mutator
Gets the mutator for the aggregate root.
public IAggregateRootMutator Mutator { get; }
Property Value
UncommittedEvents
Gets the uncommitted events for the aggregate root.
public IImmutableList<object> UncommittedEvents { get; }
Property Value
Methods
Apply(object)
Apply a single event to the aggregate root mutation.
public Task Apply(object @event)
Parameters
event
objectEvent to apply.
Returns
- Task
Awaitable task.
Commit()
Commit the mutation.
public Task<AggregateRootCommitResult> Commit()
Returns
- Task<AggregateRootCommitResult>
Awaitable task.