Table of Contents

Method PrepareAsync

Namespace
MailFathom.Application.Mail.Mutations.Local
Assembly
MailFathom.Application.dll

PrepareAsync(MailAccountId, StoredEmailId, CancellationToken)

Reads a message and places the payload its copy will carry, before the transaction that commits the copy.

public Task<PreparedLocalCopy?> PrepareAsync(MailAccountId account, StoredEmailId source, CancellationToken cancellationToken)

Parameters

account MailAccountId

The account the message is stored for.

source StoredEmailId

The message being copied.

cancellationToken CancellationToken

Propagates caller cancellation.

Returns

Task<PreparedLocalCopy>

The prepared copy, or null where the account stores no payload for the message.

Remarks

A message whose payload is not stored — one a storage ceiling deferred, or one whose content a repair has found unreadable — cannot be copied, because there is nothing to place. It is answered rather than raised: the copy is one action of a batch, and the rest of the batch is still to be applied.