Table of Contents

Method EraseCollectedAsync

Namespace
MailFathom.Application.Contacts
Assembly
MailFathom.Application.dll

EraseCollectedAsync(IPersistenceSession, MailAccountId, CancellationToken)

Erases the whole of one mail account's collected book, and everything derived from it.

Task<CollectedContactErasure> EraseCollectedAsync(IPersistenceSession session, MailAccountId account, CancellationToken cancellationToken)

Parameters

session IPersistenceSession

The session the erasure joins.

account MailAccountId

The account whose book is erased.

cancellationToken CancellationToken

Cancels the erasure.

Returns

Task<CollectedContactErasure>

What the erasure removed.

Remarks

What a user asks for when they change their mind about collection, and it is scoped to one account because collection is switched on per account: an operator disposing of what one mailbox picked up is not disposing of what another did. Nothing anybody wrote down goes with it, because nothing anybody wrote down is in this book. It is a set-based delete rather than a walk, because the alternative is loading a book of collected people into memory to remove it, and both counts are read in the same transaction that removes the rows so the answer is a fact rather than a number that was true a moment earlier.

Exceptions

ArgumentNullException

Thrown when session is null.

ArgumentException

Thrown when the session cannot supply this store's persistence context.