コード例 #1
0
            public async Task DeleteBlob(string fileName)
            {
                var blobStore = await CsCtx.GetBlobContainer(BlobContainer);

                var file = blobStore.GetBlockBlobReference(fileName);
                await file.DeleteIfExistsAsync();
            }
コード例 #2
0
            public async Task AddNewStreamFile(Stream entity, string fileName)
            {
                var blobStore = await CsCtx.GetBlobContainer(BlobContainer);

                var file = blobStore.GetBlockBlobReference(fileName);
                await file.UploadFromStreamAsync(entity);
            }
コード例 #3
0
            public async Task <string> GetStringBlob(string fileName)
            {
                var blobStore = await CsCtx.GetBlobContainer(BlobContainer);

                var file = blobStore.GetBlockBlobReference(fileName);

                if (await file.ExistsAsync())
                {
                    return(await file.DownloadTextAsync());
                }

                return(string.Empty);
            }