Table of Contents

Struct MailAccountSelector

Namespace
MailFathom.Domain.Accounts
Assembly
MailFathom.Domain.dll

Holds the text a request uses to name an account, before anything has decided which account that is.

public readonly record struct MailAccountSelector : IEquatable<MailAccountSelector>
Implements
Inherited Members

Remarks

An account can be named two ways — by the MailAccountId an operator configured or by the MailAccountDisplayName it is published under — and a caller is not required to know which of the two it is holding. The distinction is settled where the accounts the caller's user owns are known, so what travels from a protocol boundary into a use case is this: text that has been proven safe to carry and nothing more.

Both spellings are the user's own words and are unique within that user rather than across the deployment, so the same text can name a different mailbox for somebody else. That is why it is resolved against one user's accounts and never against the deployment's: text naming nothing, text naming another user's account, and text naming an account this deployment stopped serving are one refusal, and a caller cannot learn from it which of the three they were holding.

It is deliberately not a MailAccountId. Reading caller text as an identifier before it has been matched would put a value nobody configured into a type whose whole meaning is that MailFathom issued it, and the refusal for text that names no account would then be indistinguishable from a lookup of a real identity.

Fields

MaximumLength

The greatest length text naming an account may carry.

Properties

Value

Gets the text the request named an account with, trimmed.

Methods

Create(string)

Creates a selector from the text a request carried.

For(MailAccountId)

Creates the selector that names one account by its identifier.

ToString()

Returns the fully qualified type name of this instance.