示例#1
0
 public async Task ExecuteAsync(UploadFilesCommand command)
 {
     foreach (var item in command.FileMetadatas)
     {
         var id = _fsService.UploadFile(item.Name, item.Data).Result;
         await Task.Run(() =>
         {
             _domainService.WriteService.Repository <FileMetadata>().Insert(new FileMetadata {
                 Name = item.Name, FileSystemId = id
             });
         });
     }
 }
示例#2
0
        public Task ExecuteAsync(UploadFilesCommand command)
        {
            foreach (var item in command.FileMetadatas)
            {
                var id = _fsService.UploadFile(item.Name, item.Data).Result;
                _writeService.Repository <FileMetadata>().Insert(new FileMetadata {
                    Name = item.Name, FileSystemId = id
                });
                _writeService.SaveChanges();
            }

            return(Task.CompletedTask);
        }