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 }); }); } }
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); }