Exemple #1
0
        /// <summary>
        /// Ends an asynchronous operation to return a result segment of tables.
        /// </summary>
        /// <param name="asyncResult">An <see cref="IAsyncResult"/> that references the pending asynchronous operation.</param>
        /// <returns>A <see cref="TableResultSegment"/> object.</returns>
        public virtual TableResultSegment EndListTablesSegmented(IAsyncResult asyncResult)
        {
            TableQuerySegment <DynamicTableEntity> res = Executor.EndExecuteAsync <TableQuerySegment <DynamicTableEntity> >(asyncResult);

            List <CloudTable> tables = res.Results.Select(tbl => new CloudTable(
                                                              tbl.Properties[TableConstants.TableName].StringValue,
                                                              this)).ToList();

            TableResultSegment retSeg = new TableResultSegment(tables)
            {
                ContinuationToken = res.ContinuationToken
            };

            return(retSeg);
        }
Exemple #2
0
        public virtual TableResultSegment ListTablesSegmented(string prefix, int?maxResults, TableContinuationToken currentToken, TableRequestOptions requestOptions = null, OperationContext operationContext = null)
        {
            requestOptions   = TableRequestOptions.ApplyDefaultsAndClearEncryption(requestOptions, this);
            operationContext = operationContext ?? new OperationContext();
            CloudTable serviceTable = this.GetTableReference(TableConstants.TableServiceTablesName);
            TableQuerySegment <DynamicTableEntity> res =
                CloudTableClient.GenerateListTablesQuery(prefix, maxResults).ExecuteQuerySegmentedInternal(currentToken, this, serviceTable, requestOptions, operationContext);

            List <CloudTable> tables = res.Results.Select(tbl => new CloudTable(
                                                              tbl.Properties[TableConstants.TableName].StringValue,
                                                              this)).ToList();

            TableResultSegment retSeg = new TableResultSegment(tables)
            {
                ContinuationToken = res.ContinuationToken as TableContinuationToken
            };

            return(retSeg);
        }