예제 #1
0
        public async Task <Stream> GetLatestAsync(RecordRequest request)
        {
            var getLatestRequest = new GetLatestRequest
            {
                ConnectionString = request.StorageConnectionString,
                PathFormat       = request.BlobPathFormat,
                Container        = request.StorageContainer,
                Trace            = TextWriter.Null
            };

            var result = await _storageClient.GetLatestStreamAsync(getLatestRequest);

            return(result?.Stream);
        }
        public async Task <ScrapeResult> GetLatestAsync(RecordRequest request)
        {
            var getLatestRequest = new GetLatestRequest
            {
                ConnectionString = request.StorageConnectionString,
                PathFormat       = request.BlobPathFormat,
                Container        = request.StorageContainer,
                Trace            = TextWriter.Null
            };

            using (var streamResult = await _storageClient.GetLatestStreamAsync(getLatestRequest))
            {
                if (streamResult == null)
                {
                    return(null);
                }

                return(await _serializer.DeserializeAsync(streamResult.Stream, false));
            }
        }