Exemplo n.º 1
0
        public async Task <Segment <IFunctionDefinition> > GetFunctionDefinitionsAsync(string continuationToken)
        {
            var instanceTable = _tableLookup.GetTableForDateTime(TimeBucket.CommonEpoch);
            var results       = await GetFunctionDefinitionsHelperAsync(instanceTable);

            var legacyTable = LegacyTableReader.GetLegacyTable(_tableLookup);

            if (legacyTable != null)
            {
                var olderResults = await GetFunctionDefinitionsHelperAsync(legacyTable);

                results = LegacyTableReader.Merge(results, olderResults);
            }

            var segment = new Segment <IFunctionDefinition>(results);

            return(segment);
        }
        // List all tables that we may have handed out.
        public async Task <CloudTable[]> ListTablesAsync()
        {
            List <CloudTable>      list = new List <CloudTable>();
            TableContinuationToken continuationToken = null;

            do
            {
                var segment = await _tableClient.ListTablesSegmentedAsync(_tableNamePrefix, continuationToken, CancellationToken.None);

                list.AddRange(segment.Results);
                continuationToken = segment.ContinuationToken;
            }while (continuationToken != null);

            var legacyTable = LegacyTableReader.GetLegacyTable(_tableClient);

            if (legacyTable != null)
            {
                list.Add(legacyTable);
            }

            return(list.ToArray());
        }