Method RecordFiledAsync
- Namespace
- MailFathom.Application.Mail.Delivery.Drafts
- Assembly
- MailFathom.Application.dll
RecordFiledAsync(IPersistenceSession, MailDraftId, StoredEmailId, int, CancellationToken)
Writes down the stored message a held account's local drafts folder shows this draft as.
Task<StoredEmailId?> RecordFiledAsync(IPersistenceSession session, MailDraftId draftId, StoredEmailId filedEmail, int revision, CancellationToken cancellationToken)
Parameters
sessionIPersistenceSessionThe session the write joins, which is the one that stored the message.
draftIdMailDraftIdThe draft the message shows.
filedEmailStoredEmailIdThe stored message.
revisionintThe revision the stored message shows, which a later revision is compared against.
cancellationTokenCancellationTokenCancels the write.
Returns
- Task<StoredEmailId?>
The stored message the draft named before, which the caller erases in the same session, or null where it named none.
Remarks
The message replaced is answered from the row this session read rather than from the record the caller holds, so a save and a pass filing the same draft at once conflict on the draft and the one replayed erases what the other wrote.
Exceptions
- ArgumentNullException
Thrown when
sessionis null.- InvalidOperationException
Thrown when no draft is held under
draftId.