Table of Contents

Method EraseAsync

Namespace
MailFathom.Application.Folders
Assembly
MailFathom.Application.dll

EraseAsync(MailAccountId, MailFolderAlias, CancellationToken)

Erases one bounded pass of what is stored for a folder nothing mirrors any more.

public Task<MailFolderMirrorErasure> EraseAsync(MailAccountId accountId, MailFolderAlias folderAlias, CancellationToken cancellationToken)

Parameters

accountId MailAccountId

The account the folder belongs to.

folderAlias MailFolderAlias

MailFathom's own name for the folder.

cancellationToken CancellationToken

Cancels the pass before or during its single transaction.

Returns

Task<MailFolderMirrorErasure>

What this pass erased, and whether the folder still holds stored mail.

Remarks

This is the one operation that disposes of stored mail, so it asks for the grant allocated to exactly that and nothing wider reaches it. The check is here rather than only at the route because an erasure is irreversible and an entrypoint added later must not be able to perform one by omission.

Exceptions

PersistenceConcurrencyConflictException

Thrown when a competing writer wins a race the bounded retries could not resolve.

PrincipalNotAuthorizedException

Thrown when the use case was reached by anything but a caller granted AdminErase.