Struct EmailAddress
- Namespace
- MailFathom.Domain.Emails
- Assembly
- MailFathom.Domain.dll
Names one mail participant by its address and, when the sender wrote one, its display name.
public readonly record struct EmailAddress : IEquatable<EmailAddress>
- Implements
- Inherited Members
Remarks
Normalization is a domain rule rather than a query-time convenience: search, filtering, and future deduplication all depend on two addresses that differ only in case comparing equal, and a comparison form derived at each call site would drift between them. Address keeps what the message said, while NormalizedAddress is the only form anything compares, groups, or indexes on — and the only one that takes part in equality.
Properties
- Address
Gets the address exactly as the message wrote it, trimmed of surrounding whitespace.
- DisplayName
Gets the display name the message carried, or null when it carried none.
- NormalizedAddress
Gets the comparison form of Address.
Methods
- Equals(EmailAddress)
Compares two addresses by the form they were normalized to.
- GetHashCode()
Returns the hash code for this instance.
- ToString()
Returns the fully qualified type name of this instance.
- TryCreate(string?, string?, out EmailAddress)
Builds a participant address from the parts a mail header supplied.