Method AddAsync
- Namespace
- MailFathom.Application.Contacts
- Assembly
- MailFathom.Application.dll
AddAsync(IPersistenceSession, ContactBookHolder, Contact, CancellationToken)
Stages a contact the book does not yet hold.
Task AddAsync(IPersistenceSession session, ContactBookHolder holder, Contact contact, CancellationToken cancellationToken)
Parameters
sessionIPersistenceSessionThe session the write joins.
holderContactBookHolderThe book the contact is written into.
contactContactThe contact to add.
cancellationTokenCancellationTokenCancels the staging.
Returns
- Task
A task that completes once the insert is staged; nothing is committed here.
Exceptions
- ArgumentNullException
Thrown when a required argument is null.
- ArgumentException
Thrown when the session cannot supply this store's persistence context, or the contact's origin is not the one that book holds.