private async Task <ICacheAwareReadObject> CreateCacheAwareReadObjectAsync( BlobAttribute blobAttribute, ValueBindingContext context) { var cancellationToken = context.CancellationToken; var blob = await GetBlobAsync(blobAttribute, cancellationToken).ConfigureAwait(false); switch (blobAttribute.Access) { case FileAccess.Read: var readStream = await ReadBlobArgumentBinding.TryBindCacheAwareAsync(blob, context, _functionDataCache).ConfigureAwait(false); return(readStream); default: throw new InvalidOperationException("Cannot bind blob to Stream using FileAccess ReadWrite."); } }
private async Task <Stream> CreateStreamAsync( BlobAttribute blobAttribute, ValueBindingContext context) { var cancellationToken = context.CancellationToken; var blob = await GetBlobAsync(blobAttribute, cancellationToken).ConfigureAwait(false); switch (blobAttribute.Access) { case FileAccess.Read: var readStream = await ReadBlobArgumentBinding.TryBindStreamAsync(blob.BlobClient, context).ConfigureAwait(false); return(readStream); case FileAccess.Write: var writeStream = await WriteBlobArgumentBinding.BindStreamAsync(blob, context, _blobWrittenWatcherGetter.Value).ConfigureAwait(false); return(writeStream); default: throw new InvalidOperationException("Cannot bind blob to Stream using FileAccess ReadWrite."); } }
private async Task <Stream> ConvertToStreamAsync(BlobBaseClient input, CancellationToken cancellationToken) { return(await ReadBlobArgumentBinding.TryBindStreamAsync(input, cancellationToken).ConfigureAwait(false)); }
private async Task <Stream> ConvertToStreamAsync(ICloudBlob input, CancellationToken cancellationToken) { WatchableReadStream watchableStream = await ReadBlobArgumentBinding.TryBindStreamAsync(input, cancellationToken); return(watchableStream); }