EventActionsType
PackageFCQRS
C#-friendly factory methods for EventAction
Specification
Kind
Type
Members
7
Examples
0
DeferSignature
EventActions.Defer(event)
DispatchSignature
EventActions.Dispatch(description)
IgnoreSignature
EventActions.Ignore()
PersistSignature
EventActions.Persist(event)
PersistAllSignature
EventActions.PersistAll(events)
Summary
| Name | Signature | Synopsis |
|---|---|---|
| Defer | EventActions.Defer(event) | Create a DeferEvent action. |
| Dispatch | EventActions.Dispatch(description) | Create a RunAsync effect (a "mini saga" without persistence) from an INSPECTABLE description object. |
| Ignore | EventActions.Ignore() | Create an IgnoreEvent action (command is ignored, no event produced) |
| Persist | EventActions.Persist(event) | Create a PersistEvent action (event will be persisted and published) |
| PersistAll | EventActions.PersistAll(events) | Create a PersistAllEvents action: all events from this command persist as one journal AtomicWrite (all-or-nothing), with sequential versions. |
| PersistAndSnapshot | EventActions.PersistAndSnapshot(event) | Create a PersistAndSnapshot action: persist the event, then save a manual snapshot once it is durable - independent of the SnapshotPolicy cadence. |
| PersistConditionally | EventActions.PersistConditionally(shouldPersist, event) | Persist the event when `shouldPersist` is true; otherwise Defer it - the event is still published and folded but is not written to the journal or sent through a projection. |
Create a DeferEvent action. The event is published and folded but not
persisted. Rejection and idempotent-reply folds should preserve state,
because recovery cannot replay a deferred event.
Parameters
| Name | Type | Description |
|---|---|---|
| event | 'TEvent |
Returns
EventAction<'TEvent>
Create a RunAsync effect (a "mini saga" without persistence) from an
INSPECTABLE description object. The runner registered via
`InitAggregateWithEffects` executes it and self-dispatches the resulting
command. EPHEMERAL (not journaled, so a crash mid-flight loses it) and
TOTAL (the runner must map failure to a command). See EventAction.RunAsync.
Parameters
| Name | Type | Description |
|---|---|---|
| description | obj |
Returns
EventAction<'TEvent>
Create an IgnoreEvent action (command is ignored, no event produced)
Returns
EventAction<'TEvent>
Create a PersistEvent action (event will be persisted and published)
Parameters
| Name | Type | Description |
|---|---|---|
| event | 'TEvent |
Returns
EventAction<'TEvent>
Create a PersistAllEvents action: all events from this command persist as
one journal AtomicWrite (all-or-nothing), with sequential versions. State
updates and publishes happen only after the whole batch is durable.
Parameters
| Name | Type | Description |
|---|---|---|
| events | 'TEvent[] |
Returns
EventAction<'TEvent>
Create a PersistAndSnapshot action: persist the event, then save a manual
snapshot once it is durable - independent of the SnapshotPolicy cadence.
Parameters
| Name | Type | Description |
|---|---|---|
| event | 'TEvent |
Returns
EventAction<'TEvent>
Persist the event when `shouldPersist` is true; otherwise Defer it - the
event is still published and folded but is not written to the journal or
sent through a projection. Its fold should preserve the current state.
The idempotent "emit this verdict, but only
write it once" shape, e.g. re-approving an already-approved aggregate:
`PersistConditionally(state.Approval != Approved, new Approved(id))`.
Parameters
| Name | Type | Description |
|---|---|---|
| shouldPersist | bool | |
| event | 'TEvent |
Returns
EventAction<'TEvent>