Table of Contents

Class ContactBookHolder

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

Names whose contact book one act reads or writes: a user's own, or a mail account's.

public sealed record ContactBookHolder : IEquatable<ContactBookHolder>
Inheritance
ContactBookHolder
Implements
Inherited Members

Remarks

There are two kinds of book and the kind decides the origin of everything in it. A user holds the people they wrote down, which is Asserted; a mail account holds the people its mail says it corresponds with, which is Collected. So a holder is not merely a key a row is filed under — it is the whole of what makes collection unable to write into a user's book and a user unable to amend what a mailbox picked up.

A mailbox is one mailbox however many people are assigned it, which is what puts the collected book on the account rather than on each of them: an address the account corresponds with is recorded once and every assigned user reads that one record, instead of one copy per person appearing the day an administrator assigns a second.

Key is what the store files a row under, and it is text because the two identifiers are: a user is a UUID and a mail account is the identifier the deployment generated for its record, which the mail graph beside this one already records as text. It leads with the kind, and that prefix is load-bearing rather than decorative: the two are UUIDs minted independently of each other, so nothing about either makes it unable to equal the other, and one that did would make that user's own book and that mailbox's collected book one key — every read narrows on the key alone, so every other user assigned the account would read that user's own contacts. Neither value is checked against the other's table anywhere, and no constraint could be: the prefix is what makes the two namespaces unable to meet, and the check constraint on the table asserts the same derivation so a row cannot be filed under a key its own holder columns do not produce.

Fields

AccountKeyPrefix

The prefix a mail account's collected book's key carries, which is what keeps it out of the users'.

UserKeyPrefix

The prefix a user's own book's key carries, which is what keeps it out of the accounts' namespace.

Properties

Account

Gets the mail account whose collected book this is, or null when it is a user's own.

Key

Gets the value a row of this book is filed under, which leads with the kind of holder it names.

Origin

Gets the origin every contact in this book carries.

User

Gets the user whose own book this is, or null when it is a mail account's.

Methods

Of(UserId)

Names one user's own book, which holds the people they wrote down.

Of(MailAccountId)

Names one mail account's book, which holds the people its mail says it corresponds with.