public static AttachmentDO CreateNewAttachment(Attachment attachment) { AttachmentDO att = new AttachmentDO { OriginalName = attachment.Name, Type = attachment.ContentType.MediaType, }; att.SetData(attachment.ContentStream); return(att); }
public static AttachmentDO CreateNewAttachment(AlternateView av) { if (av.ContentType.MediaType == "text/html") { return(null); } AttachmentDO att = new AttachmentDO { OriginalName = String.IsNullOrEmpty(av.ContentType.Name) ? "unnamed" : av.ContentType.Name, Type = av.ContentType.MediaType, ContentID = av.ContentId }; att.SetData(av.ContentStream); return(att); }