Table of Contents

Method ReviseAsync

Namespace
MailFathom.Application.Mail.Delivery.Drafts
Assembly
MailFathom.Application.dll

ReviseAsync(IPersistenceSession, MailDraftId, IReadOnlyList<MailDraftRecipient>, string, long, DateTimeOffset, CancellationToken)

Advances a draft to a new revision, before any command replacing its copy goes out.

Task<MailDraftRecord> ReviseAsync(IPersistenceSession session, MailDraftId draftId, IReadOnlyList<MailDraftRecipient> recipients, string subject, long mimeByteLength, DateTimeOffset revisedAt, CancellationToken cancellationToken)

Parameters

session IPersistenceSession

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

draftId MailDraftId

The draft being revised.

recipients IReadOnlyList<MailDraftRecipient>

The people the new revision is addressed to, each with where its address came from.

subject string

The subject line the new composed message carries.

mimeByteLength long

How many bytes the new stored message is.

revisedAt DateTimeOffset

When the revision was written down.

cancellationToken CancellationToken

Cancels the write.

Returns

Task<MailDraftRecord>

The draft as the write left it, with the copy it replaces now superseded.

Remarks

It writes nothing about the mail server and issues no command. What it does is make the intent durable — this is now revision n, and the copy carrying revision n-1 is one to take back out — so a process that dies before either command still leaves the previous copy standing and nameable, which is one draft rather than none.

Exceptions

ArgumentNullException

Thrown when session or recipients is null.

InvalidOperationException

Thrown when no draft is held under draftId, or when it has already been discarded.