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
accountMailAccountIdThe account the message is stored for.
sourceStoredEmailIdThe message being copied.
cancellationTokenCancellationTokenPropagates 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.