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
displayNameContactDisplayNameThe name to record instead.
addressesIReadOnlyCollection<EmailAddress>Every address this person uses after the amendment.
preferredAddressEmailAddressThe address to use by default after the amendment.
noteContactNote?What the owner wrote about this person, or null to hold none.
amendedAtDateTimeOffsetWhen 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
addressesis null.- ArgumentException
Thrown when no address is supplied or when
preferredAddressis not among them.