Table of Contents

Method CollectAsync

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

CollectAsync(MailAccountId, NewContact, CancellationToken)

Records a person collection inferred from arriving mail, in the book of the account it arrived on.

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

Parameters

account MailAccountId

The account being synchronized, whose book the record goes into.

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 of that account's book that already holds one of its addresses.

Remarks

The act collection performs, and the one act on these books 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 a collected book 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 a user'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.