public Attachment GetLinkFromAttachment(string partionKey, string rowKey, long contentLength, string fileName, Stream inputStream, string contentType)
        {
            if (contentLength > 0)
            {
                // Save to database
                var doc = new Attachment(partionKey, rowKey)
                {
                    FileName = fileName,
                    ContentType = contentType,
                    ContentLength = contentLength,
                };
                _blobRepository.Upload(doc, inputStream);

                _attachmentRepository.Insert(doc);

                return doc;
            }
            return null;
        }
Exemple #2
0
 public static Attachment CreateCopy(Attachment attachment)
 {
     return new Attachment(attachment);
 }