示例#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);
            }