Method FindHoldersOfAsync
- Namespace
- MailFathom.Application.Contacts
- Assembly
- MailFathom.Application.dll
FindHoldersOfAsync(IReadOnlyCollection<EmailAddress>, CancellationToken)
Reads which contacts already hold each of the given addresses.
Task<IReadOnlyDictionary<EmailAddress, ContactId>> FindHoldersOfAsync(IReadOnlyCollection<EmailAddress> addresses, CancellationToken cancellationToken)
Parameters
addressesIReadOnlyCollection<EmailAddress>The addresses to look up, at most as many as one contact may hold.
cancellationTokenCancellationTokenCancels the read.
Returns
- Task<IReadOnlyDictionary<EmailAddress, ContactId>>
An entry for every address the book already holds, keyed by the address as supplied; addresses nobody holds are absent.
Remarks
One lookup for a whole record rather than one per address, because this is what a write asks before claiming a set of addresses and a query per address would make a contact's cost depend on how many mailboxes a person uses.
Exceptions
- ArgumentNullException
Thrown when
addressesis null.- ArgumentOutOfRangeException
Thrown when more addresses are supplied than one contact may hold.