Table of Contents

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

session IPersistenceSession

The transaction the copy commits in.

copy PreparedLocalCopy

The prepared copy.

binding MailFolderResolutionId

The folder binding the copy is stored under, which is the copied message's own.

folder LocalMailFolderId

The local folder the copy is filed into.

flags CopiedMailFlags

The flags and keywords the copied message carries, which the copy takes.

cancellationToken CancellationToken

Propagates 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 copy is null.