Method RecordPlacementIssuedAsync
- Namespace
- MailFathom.Application.Mail.Mutations
- Assembly
- MailFathom.Application.dll
RecordPlacementIssuedAsync(IPersistenceSession, MailboxMutationRecordId, bool, CancellationToken)
Moves the record to PlacementIssued and states what the command will leave behind.
Task RecordPlacementIssuedAsync(IPersistenceSession session, MailboxMutationRecordId recordId, bool requiresSourceRemoval, CancellationToken cancellationToken)
Parameters
sessionIPersistenceSessionThe session the write joins.
recordIdMailboxMutationRecordIdThe record to advance.
requiresSourceRemovalbooltrue when the command leaves the source in place and a separate removal will be owed.
cancellationTokenCancellationTokenCancels the write.
Returns
- Task
A task that completes when the stage and the answer are written.
Remarks
It is a transition of its own rather than a flag on AdvanceAsync(IPersistenceSession, MailboxMutationRecordId, MailboxMutationStage, RemoteEmailPlacement?, CancellationToken), because this is the only stage the answer is knowable at and the only one it means anything for. Writing both in one transaction is what stops a crash between them from leaving a placement whose obligation nobody recorded.
Exceptions
- ArgumentNullException
Thrown when
sessionis null.- InvalidOperationException
Thrown when no record carries
recordId, or when the record has already passed this stage.