Table of Contents

Method CollectAsync

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

CollectAsync(NewContact, CancellationToken)

Records a person collection inferred from arriving mail.

public Task<ContactWriteResult> CollectAsync(NewContact newContact, CancellationToken cancellationToken)

Parameters

newContact NewContact

The person to record, which collection states under its own origin.

cancellationToken CancellationToken

Cancels the write.

Returns

Task<ContactWriteResult>

The record as written, or the contact that already holds one of its addresses.

Remarks

The act collection performs, and the one act on this book no caller can reach. It admits the process identity alone rather than a permission, because work nobody requested is what it is: a grant would make it reachable by whoever an operator granted that name to, and writing into the collected origin is precisely the authority the origin rule exists to keep away from a caller.

It refuses a record naming any origin but Collected, so the one writer that could award itself an owner's authority cannot do it by stating a different origin on the way in.

Exceptions

ArgumentNullException

Thrown when newContact is null.

ArgumentException

Thrown when the supplied record does not name the collected origin, or does 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 MailFathom's own identity.