当前位置: 首页>>代码示例>>C#>>正文


C# CloudTable.ExecuteQuerySegmented方法代码示例

本文整理汇总了C#中Microsoft.WindowsAzure.Storage.Table.CloudTable.ExecuteQuerySegmented方法的典型用法代码示例。如果您正苦于以下问题:C# CloudTable.ExecuteQuerySegmented方法的具体用法?C# CloudTable.ExecuteQuerySegmented怎么用?C# CloudTable.ExecuteQuerySegmented使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.WindowsAzure.Storage.Table.CloudTable的用法示例。


在下文中一共展示了CloudTable.ExecuteQuerySegmented方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CopyTable

        private void CopyTable(CloudTable table)
        {
            var destTableClient = _destAccount.CreateCloudTableClient();
            ConsoleWrite.Verbose("  Creating Table {0}", table.Name);
            var destTable = destTableClient.GetTableReference(table.Name);
            if (_args.IsReal)
                destTable.Create();

            var tableQuery = new TableQuery();
            TableContinuationToken continuationToken = null;
            do
            {
                var tableQueryResult =
                    table.ExecuteQuerySegmented(tableQuery, continuationToken);

                continuationToken = tableQueryResult.ContinuationToken;

                ConsoleWrite.Verbose("   Retrieved {0} rows{1}.", tableQueryResult.Results.Count, continuationToken != null ? " of more" : "");

                foreach (var entity in tableQueryResult)
                    CopyEntity(entity, destTable);

            } while (continuationToken != null);
        }
开发者ID:colinangusmackay,项目名称:xander-azure-tools,代码行数:24,代码来源:CopyCommand.cs

示例2: ExecuteBalanceQuery

 private IEnumerable<DynamicTableEntity> ExecuteBalanceQuery(CloudTable table, TableQuery tableQuery, IEnumerable<int> pages)
 {
     pages = pages ?? new int[0];
     var pagesEnumerator = pages.GetEnumerator();
     TableContinuationToken continuation = null;
     do
     {
         tableQuery.TakeCount = pagesEnumerator.MoveNext() ? (int?)pagesEnumerator.Current : null;
         var segment = table.ExecuteQuerySegmented(tableQuery, continuation);
         continuation = segment.ContinuationToken;
         foreach(var entity in segment)
         {
             yield return entity;
         }
     } while(continuation != null);
 }
开发者ID:bijakatlykkex,项目名称:NBitcoin.Indexer,代码行数:16,代码来源:IndexerClient.cs

示例3: ProcessEntities

        private static void ProcessEntities(CloudTable table, Action<IEnumerable<DynamicTableEntity>> processor, Expression<Func<DynamicTableEntity, bool>> filters)
        {
            TableQuerySegment<DynamicTableEntity> segment = null;

            while (segment == null || segment.ContinuationToken != null)
            {
                if (filters == null)
                {
                    segment = table.ExecuteQuerySegmented(new TableQuery().Take(100), segment == null ? null : segment.ContinuationToken);
                }
                else
                {
                    var query = table.CreateQuery<DynamicTableEntity>().Where(filters).Take(100).AsTableQuery();
                    segment = query.ExecuteSegmented(segment == null ? null : segment.ContinuationToken);
                }

                processor(segment.Results);
            }
        }
开发者ID:rhizohm,项目名称:ElmahTableStorageToCSV,代码行数:19,代码来源:Program.cs

示例4: RetrieveAll

        static List<DynamicTableEntity> RetrieveAll(CloudTable table, IQueryable<DynamicTableEntity> query)
        {
            var entities = new List<DynamicTableEntity>();
            TableContinuationToken token = null;

            do
            {
                var page = query.Take(512);

                var segment = table.ExecuteQuerySegmented((TableQuery<DynamicTableEntity>)page, token);
                token = segment.ContinuationToken;

                entities.AddRange(segment.Results);
            }
            while (token != null);

            return entities;
        }
开发者ID:kowalot,项目名称:Streamstone,代码行数:18,代码来源:Storage.cs


注:本文中的Microsoft.WindowsAzure.Storage.Table.CloudTable.ExecuteQuerySegmented方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。