示例#1
0
        protected List <AttachmentsStaging> MakeAttachmentsStaging(List <AttachmentsModel> attachments, String attachedBy)
        {
            // make change request comments staging.
            List <AttachmentsStaging> attachmentsStaging = new List <AttachmentsStaging>();

            if (attachments == null || attachments.Count == 0)
            {
                return(attachmentsStaging);
            }

            AttachmentsStaging attachmentStaging;

            attachments.ForEach(attachment =>
            {
                attachmentStaging = new AttachmentsStaging
                {
                    AttachmentId       = attachment.AttachmentId,
                    AttachedBy         = attachedBy,
                    FileExtension      = attachment.FileExtension,
                    FileName           = attachment.FileName,
                    DirectoryPath      = attachment.DirectoryPath,
                    CreatedDateTime    = DateTime.UtcNow,
                    AzureContainerName = attachment.ContainerName,
                    ContentType        = attachment.ContentType,
                    BlocksIdList       = attachment.ChunksIdList?.Split(',').ToList(),
                    FileSize           = attachment.FileSize,
                    FileStatus         = attachment.FileStatus
                };

                attachmentsStaging.Add(attachmentStaging);
            });

            return(attachmentsStaging);
        }
 protected async Task SaveFileToTempLocation(AttachmentsStaging attachment)
 {
     await _azureFileStorageRepositoryService.SaveFileAsync(new AzureFileModel
     {
         BlobName      = attachment.FileName,
         ContainerName = attachment.AzureContainerName,
         ContentType   = attachment.ContentType,
         ChunkIdList   = attachment.BlocksIdList
     });
 }