Table of Contents

Method HoldsAddressAsync

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

HoldsAddressAsync(MailAccountId, EmailAddress, CancellationToken)

Answers whether one account's own book already holds an address, without answering whose it is.

public Task<bool> HoldsAddressAsync(MailAccountId account, EmailAddress address, CancellationToken cancellationToken)

Parameters

account MailAccountId

The account whose book is asked about.

address EmailAddress

The address to look for, matched on its comparison form.

cancellationToken CancellationToken

Cancels the read.

Returns

Task<bool>

true when some contact of that account's book holds it.

Remarks

The read collection performs before it decides whether to record somebody, and it answers a question rather than producing a record deliberately: collection needs to know that an address is spoken for, and handing it the contact would put a person into the hands of work that may not touch them. It asks about the account's own book alone, because that is the book it would be writing into — what a user of that mailbox happens to have written down in their own book is theirs, and is answered for at the read instead. It admits the process identity alone, for the reason CollectAsync(MailAccountId, NewContact, CancellationToken) does.

Exceptions

PrincipalNotAuthorizedException

Thrown when the read was reached by anything but MailFathom's own identity.