Beispiel #1
0
        protected override async ValueTask <IActivityExecutionResult> OnExecuteAsync(ActivityExecutionContext context)
        {
            await _filesApi.UploadAsync(
                new UploadRequest
            {
                Mode = new UploadMode
                {
                    Tag = UploadModeUnion.Overwrite
                },
                Path = Path,
            },
                FileData,
                context.CancellationToken
                );

            return(Done());
        }
Beispiel #2
0
        public async Task UploadFileAsync(string merchantId, byte[] content, string fileName, string contentType)
        {
            var streamPart = new StreamPart(new MemoryStream(content), fileName, contentType);

            await _runner.RunWithDefaultErrorHandlingAsync(() => _filesApi.UploadAsync(merchantId, streamPart));
        }
        public async Task UploadFileAsync(string invoiceId, byte[] content, string fileName, string contentType)
        {
            var streamPart = new StreamPart(new MemoryStream(content), fileName, contentType);

            await _runner.RunAsync(() => _filesApi.UploadAsync(invoiceId, streamPart));
        }