Class EmailAddress
Represents an email address with an optional display name.
public sealed class EmailAddress : IEquatable<EmailAddress>
- Inheritance
-
EmailAddress
- Implements
- Inherited Members
Constructors
EmailAddress(string, string?)
Creates an email address.
public EmailAddress(string address, string? displayName = null)
Parameters
Properties
Address
The raw email address (for example, "john@example.com").
public string Address { get; }
Property Value
DisplayName
An optional display name shown next to the address.
public string? DisplayName { get; }
Property Value
Methods
Equals(EmailAddress?)
Returns true if this address equals another by comparing both components.
public bool Equals(EmailAddress? other)
Parameters
otherEmailAddress
Returns
Equals(object?)
Returns true if this address equals another object.
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
Returns a hash code for this address.
public override int GetHashCode()
Returns
ToString()
Returns "Display Name <address>" when a display name is set, otherwise the address.
public override string ToString()