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