Table of Contents

Method MatchDisplayNamesAsync

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

MatchDisplayNamesAsync(IReadOnlyCollection<ContactDisplayName>, CancellationToken)

Reads who each name resolves to, by the whole of that name rather than by part of it.

Task<IReadOnlyDictionary<ContactDisplayName, ContactMatch>> MatchDisplayNamesAsync(IReadOnlyCollection<ContactDisplayName> displayNames, CancellationToken cancellationToken)

Parameters

displayNames IReadOnlyCollection<ContactDisplayName>

The names to resolve, at most one page of the book's worth.

cancellationToken CancellationToken

Cancels the read.

Returns

Task<IReadOnlyDictionary<ContactDisplayName, ContactMatch>>

An entry for every supplied name, keyed by the name as supplied, carrying the one contact under it or how many carry it; a name nobody carries reports none.

Remarks

The comparison is on each name's whole comparison form, which is what separates this from the contained match a page's search performs: a lookup that addresses a message resolves to one person or to nobody, and text that merely appears inside somebody's name is not that person being named. Both are answered from the listing index the book is ordered by.

The count an ambiguous name answers with is exact, and the addresses of the people it counted are never read, so a name a hundred collected contacts happen to share costs one number rather than a page of somebody else's correspondents. A name resolving to one person answers with that person and with the count that decided it read together, so no caller can be handed a contact the book no longer holds uniquely.

Every supplied name is answered rather than only the ones somebody carries, because ContactMatch already states "nobody" and a caller reading a set has to tell that answer from a name the read never covered.

Exceptions

ArgumentNullException

Thrown when displayNames is null.

ArgumentOutOfRangeException

Thrown when more names are supplied than one page of the book holds.