Method EraseAsync
- Namespace
- MailFathom.Application.Contacts
- Assembly
- MailFathom.Application.dll
EraseAsync(IPersistenceSession, ContactBookScope, ContactId, CancellationToken)
Erases one contact and everything derived from it, from whichever book of the scope holds it.
Task<ContactErasure> EraseAsync(IPersistenceSession session, ContactBookScope scope, ContactId contactId, CancellationToken cancellationToken)
Parameters
sessionIPersistenceSessionThe session the erasure joins.
scopeContactBookScopeThe books the erasure may reach.
contactIdContactIdThe contact to erase.
cancellationTokenCancellationTokenCancels the erasure.
Returns
- Task<ContactErasure>
What the erasure removed, including a scope that showed no such contact.
Remarks
Answering for a contact no book of the scope holds is a completed erasure rather than a failure: the state the caller asked for is the state the books are in, and reporting it as an error would only tell them whether somebody had already erased that person.
Exceptions
- ArgumentNullException
Thrown when a required argument is null.
- ArgumentException
Thrown when the session cannot supply this store's persistence context.