Method CommitAsync
- Namespace
- MailFathom.Application.Mail.Mutations.Local
- Assembly
- MailFathom.Application.dll
CommitAsync(IPersistenceSession, PreparedLocalCopy, MailFolderResolutionId, LocalMailFolderId, CopiedMailFlags, CancellationToken)
Writes a prepared copy as a stored message of its own, inside the transaction the copy commits in.
public Task<StoredEmailId?> CommitAsync(IPersistenceSession session, PreparedLocalCopy copy, MailFolderResolutionId binding, LocalMailFolderId folder, CopiedMailFlags flags, CancellationToken cancellationToken)
Parameters
sessionIPersistenceSessionThe transaction the copy commits in.
copyPreparedLocalCopyThe prepared copy.
bindingMailFolderResolutionIdThe folder binding the copy is stored under, which is the copied message's own.
folderLocalMailFolderIdThe local folder the copy is filed into.
flagsCopiedMailFlagsThe flags and keywords the copied message carries, which the copy takes.
cancellationTokenCancellationTokenPropagates caller cancellation.
Returns
- Task<StoredEmailId?>
The copy's identity, or null where the binding it was prepared against is gone.
Remarks
The copy takes the copied message's binding rather than the destination's, for the reason a local move leaves the binding alone: no local act moves an occurrence, and the binding is where the source folder held the message rather than where MailFathom keeps it. The copy holds no occurrence at all, because no server placed it.
Exceptions
- ArgumentNullException
Thrown when
copyis null.