Apply
Marks a method of an aggregate as one that modifies the state of the aggregate with data from the passed event.
As we apply the event to the aggregate state, we call such a method Event Applier.
An event applier method:
- is annotated with Apply;
- is
private
; - is
void
; - accepts an event derived from EventMessage as the only parameter.
To update the state of the aggregate, the builder method should be used.
If the annotation comes with the attribute allowImport set to true
, the aggregate can receive incoming events as if they were produced by the aggregate.