public async Task <byte[]> Read(string blobName) { var blob = _filesStorageService.GetBlob(blobName); if (!await blob.ExistsAsync()) { return(null); } var text = await blob.DownloadTextAsync(); return(Encoding.UTF8.GetBytes(text)); }
public async Task <byte[]> Read(string blobName) { var blob = _filesStorageService.GetBlob(blobName); if (!await blob.ExistsAsync()) { return(null); } using (var memoryStream = new MemoryStream()) { await blob.DownloadToStreamAsync(memoryStream); return(memoryStream.ToArray()); } }