/// <summary> /// Clones this CommunicationTemplateAttachment object to a new CommunicationTemplateAttachment object /// </summary> /// <param name="source">The source.</param> /// <param name="deepCopy">if set to <c>true</c> a deep copy is made. If false, only the basic entity properties are copied.</param> /// <returns></returns> public static CommunicationTemplateAttachment Clone(this CommunicationTemplateAttachment source, bool deepCopy) { if (deepCopy) { return(source.Clone() as CommunicationTemplateAttachment); } else { var target = new CommunicationTemplateAttachment(); target.CopyPropertiesFrom(source); return(target); } }
/// <summary> /// Copies the properties from another CommunicationTemplateAttachment object to this CommunicationTemplateAttachment object /// </summary> /// <param name="target">The target.</param> /// <param name="source">The source.</param> public static void CopyPropertiesFrom(this CommunicationTemplateAttachment target, CommunicationTemplateAttachment source) { target.Id = source.Id; target.BinaryFileId = source.BinaryFileId; target.CommunicationTemplateId = source.CommunicationTemplateId; target.CommunicationType = source.CommunicationType; target.ForeignGuid = source.ForeignGuid; target.ForeignKey = source.ForeignKey; target.CreatedDateTime = source.CreatedDateTime; target.ModifiedDateTime = source.ModifiedDateTime; target.CreatedByPersonAliasId = source.CreatedByPersonAliasId; target.ModifiedByPersonAliasId = source.ModifiedByPersonAliasId; target.Guid = source.Guid; target.ForeignId = source.ForeignId; }
/// <summary> /// Adds the attachment. /// Specify CommunicationType.Email for Email and CommunicationType.SMS for SMS /// </summary> /// <param name="communicationTemplateAttachment">The communication template attachment.</param> /// <param name="communicationType">Type of the communication.</param> public void AddAttachment(CommunicationTemplateAttachment communicationTemplateAttachment, CommunicationType communicationType) { communicationTemplateAttachment.CommunicationType = communicationType; this.Attachments.Add(communicationTemplateAttachment); }