Method RecordAsync
- Namespace
- MailFathom.Application.Contacts
- Assembly
- MailFathom.Application.dll
RecordAsync(NewContact, CancellationToken)
Records a person the book does not yet hold.
public Task<ContactWriteResult> RecordAsync(NewContact newContact, CancellationToken cancellationToken)
Parameters
newContactNewContactThe person to record and the origin the writer acts under.
cancellationTokenCancellationTokenCancels the write.
Returns
- Task<ContactWriteResult>
The record as written, or the contact that already holds one of its addresses.
Remarks
The identity is minted here, from a UUID version 7 over the instant of the write, so the book's own identifiers order the way the records were created without a caller being able to choose one.
Exceptions
- ArgumentNullException
Thrown when
newContactis null.- ArgumentException
Thrown when the supplied addresses do not form a contact the domain admits.
- PersistenceConcurrencyConflictException
Thrown when every allowed attempt lost the race.
- PrincipalNotAuthorizedException
Thrown when the write was reached by anything but a caller granted AdminOperate.