Method RecordDiscardedAsync
- Namespace
- MailFathom.Application.Mail.Delivery.Drafts
- Assembly
- MailFathom.Application.dll
RecordDiscardedAsync(IPersistenceSession, MailDraftId, DateTimeOffset, CancellationToken)
Writes down that this draft has been given up, before its copies are taken out of the folder.
Task RecordDiscardedAsync(IPersistenceSession session, MailDraftId draftId, DateTimeOffset discardedAt, CancellationToken cancellationToken)
Parameters
sessionIPersistenceSessionThe session the write joins.
draftIdMailDraftIdThe draft being given up.
discardedAtDateTimeOffsetWhen it was given up.
cancellationTokenCancellationTokenCancels the write.
Returns
- Task
A task that completes when the row says so.
Remarks
The row outlives the decision on purpose. Removing it first would lose the only thing naming the copies, and a copy nothing can name is a message left in the owner's drafts folder for good.
Exceptions
- ArgumentNullException
Thrown when
sessionis null.- InvalidOperationException
Thrown when no draft is held under
draftId.