Table of Contents

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

session IPersistenceSession

The session the write joins, which is the one that stored the message.

draftId MailDraftId

The draft the message shows.

filedEmail StoredEmailId

The stored message.

revision int

The revision the stored message shows, which a later revision is compared against.

cancellationToken CancellationToken

Cancels 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 session is null.

InvalidOperationException

Thrown when no draft is held under draftId.