public static MailAddress ToMailAddress(this EmailAddressEmbedded address) { if (address.DisplayName != null) { return(new MailAddress(address.EmailAddress, address.DisplayName)); } return(new MailAddress(address.EmailAddress)); }
public static EmailAddress ToEmailAddress(this EmailAddressEmbedded address) { if (address.DisplayName.HasText()) { return(new EmailAddress(address.DisplayName, address.EmailAddress)); } return(new EmailAddress(address.EmailAddress)); }
public static Recipient ToRecipient(this EmailAddressEmbedded address) { return(new Recipient { EmailAddress = new EmailAddress { Address = address.EmailAddress, Name = address.DisplayName } }); }