Class ContactMatch
- Namespace
- MailFathom.Application.Contacts
- Assembly
- MailFathom.Application.dll
States who a lookup of the book resolved to: how many people answer to it, and which one when exactly one does.
public sealed record ContactMatch : IEquatable<ContactMatch>
- Inheritance
-
ContactMatch
- Implements
- Inherited Members
Remarks
The count is here because a caller that cannot use the answer still has to be told what was wrong with it, and the only thing it may be told is how many. A name several people carry resolves to nobody — nothing ranks them and nothing picks the closest — so the record carries the number and none of the contacts it counted. A lookup by identity answers in the same shape and never counts past one, which is what lets a caller act on the count rather than on how the contact was named.
The contact is present for exactly one match, which is what makes the unique case usable without a second read and the ambiguous case impossible to use by accident.
Properties
- MatchCount
Gets how many contacts carry the name.
- None
Gets a match reporting that nobody in the book carries the name.
- OnlyMatch
Gets the contact carrying the name, which is present exactly when MatchCount is one.
Methods
- Several(int)
Reports that several people carry the name, and how many.
- Unique(Contact)
Reports the one person the book holds under the name.