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
accountIdMailAccountIdThe account the folder belongs to.
folderAliasMailFolderAliasMailFathom's own name for the folder.
cancellationTokenCancellationTokenCancels 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.