Table of Contents

Method FindHoldersOfAsync

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

FindHoldersOfAsync(ContactBookHolder, IReadOnlyCollection<EmailAddress>, CancellationToken)

Reads which contacts of one book already hold each of the given addresses.

Task<IReadOnlyDictionary<EmailAddress, ContactId>> FindHoldersOfAsync(ContactBookHolder holder, IReadOnlyCollection<EmailAddress> addresses, CancellationToken cancellationToken)

Parameters

holder ContactBookHolder

The book read.

addresses IReadOnlyCollection<EmailAddress>

The addresses to look up, at most as many as one contact may hold.

cancellationToken CancellationToken

Cancels the read.

Returns

Task<IReadOnlyDictionary<EmailAddress, ContactId>>

An entry for every address that book already holds, keyed by the address as supplied; addresses nobody in it holds are absent.

Remarks

One book rather than a scope, because this is what a write asks before claiming a set of addresses and the rule it is asking about — one address, one contact — holds within a book rather than across them. One lookup for a whole record rather than one per address, so a contact's cost does not depend on how many mailboxes a person uses.

Exceptions

ArgumentNullException

Thrown when a required argument is null.

ArgumentOutOfRangeException

Thrown when more addresses are supplied than one contact may hold.