Table of Contents

Method AmendedWith

Namespace
MailFathom.Domain.Contacts
Assembly
MailFathom.Domain.dll

AmendedWith(ContactDisplayName, IReadOnlyCollection<EmailAddress>, EmailAddress, ContactNote?, DateTimeOffset)

Produces this contact with the parts an amendment replaced, keeping its identity, origin, and arrival.

public Contact AmendedWith(ContactDisplayName displayName, IReadOnlyCollection<EmailAddress> addresses, EmailAddress preferredAddress, ContactNote? note, DateTimeOffset amendedAt)

Parameters

displayName ContactDisplayName

The name to record instead.

addresses IReadOnlyCollection<EmailAddress>

Every address this person uses after the amendment.

preferredAddress EmailAddress

The address to use by default after the amendment.

note ContactNote?

What the owner wrote about this person, or null to hold none.

amendedAt DateTimeOffset

When the amendment happened.

Returns

Contact

The amended contact.

Remarks

An amendment states the record the owner wants rather than the difference from the one held, which is what keeps removing an address, adding one, and choosing a different preferred address one operation instead of three that could each leave the record in a shape the invariants above refuse.

Exceptions

ArgumentNullException

Thrown when addresses is null.

ArgumentException

Thrown when no address is supplied or when preferredAddress is not among them.