Method PrepareCopiesAsync
- Namespace
- MailFathom.Application.Rules.Actions
- Assembly
- MailFathom.Application.dll
PrepareCopiesAsync(MailAccountId, IReadOnlyCollection<StoredEmailId>, CancellationToken)
Places the payload of every copy a batch asks for, before the transaction that records them opens.
public Task<PreparedLocalCopies> PrepareCopiesAsync(MailAccountId account, IReadOnlyCollection<StoredEmailId> sources, CancellationToken cancellationToken)
Parameters
accountMailAccountIdThe account the batch acts on.
sourcesIReadOnlyCollection<StoredEmailId>The email each planned copy duplicates, one entry per copy action.
cancellationTokenCancellationTokenPropagates caller cancellation.
Returns
- Task<PreparedLocalCopies>
The placed copies, or none at all where the account is not held.
Remarks
It is handed on to the submission rather than performed here, for the reason Announce(IEnumerable<AppliedMailboxChange>) is: the choice of executor is the submission's, so a rule pass asks the recorder it already talks to instead of gaining a second collaborator to ask about the same account.