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


C# CloudTableClient.ListTablesSegmentedAsync方法代码示例

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


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

示例1: ClassCleanup

      public static void ClassCleanup()
      {
         var storageAccountProvider = Configuration.GetTestStorageAccount();

         var client = new CloudTableClient( new Uri( storageAccountProvider.TableEndpoint ), storageAccountProvider.Credentials );

         TableContinuationToken token = new TableContinuationToken();
         do
         {
            var orphanedTables = client.ListTablesSegmentedAsync( _baseTableName, token ).Result;
            token = orphanedTables.ContinuationToken;
            foreach ( CloudTable orphanedTableName in orphanedTables.Results )
            {
               client.GetTableReference( orphanedTableName.Name ).DeleteIfExistsAsync().Wait();
            }
         }
         while ( token != null );
      }
开发者ID:TechSmith,项目名称:hyde,代码行数:18,代码来源:SaveAtomicallyTest.cs

示例2: ListAllTablesAsync

        private async Task<List<CloudTable>> ListAllTablesAsync(CloudTableClient tableClient, string prefix, TableRequestOptions options)
        {
            TableContinuationToken token = null;
            List<CloudTable> tables = new List<CloudTable>();
            do
            {
                TableResultSegment resultSegment = await tableClient.ListTablesSegmentedAsync(prefix, null /* maxResults*/, token, options, null);
                tables.AddRange(resultSegment.Results);
                token = resultSegment.ContinuationToken;
            } while (token != null);

            return tables;
        }
开发者ID:benaadams,项目名称:azure-storage-net,代码行数:13,代码来源:TableEntityEncryptionTests.cs

示例3: ListTablesWithPrefix

        /// <summary>
        /// Lists tables in the storage account whose names begin with the specified prefix.
        /// </summary>
        /// <param name="tableClient">The Table service client object.</param>
        /// <param name="prefix">The table name prefix.</param>
        /// <returns>A Task object</returns>
        private static async Task ListTablesWithPrefix(CloudTableClient tableClient, string prefix)
        {
            Console.WriteLine("List all tables beginning with prefix {0}:", prefix);

            TableContinuationToken continuationToken = null;
            TableResultSegment resultSegment = null;

            try
            {
                do
                {
                    // List tables beginning with the specified prefix. 
                    // Passing in null for the maxResults parameter returns the maximum number of results (up to 5000).
                    resultSegment = await tableClient.ListTablesSegmentedAsync(
                        prefix, null, continuationToken, null, null);

                    // Enumerate the tables returned.
                    foreach (var table in resultSegment.Results)
                    {
                        Console.WriteLine("\tTable:" + table.Name);
                    }
                }
                while (continuationToken != null);
                Console.WriteLine();
            }
            catch (StorageException e)
            {
                Console.WriteLine(e.Message);
                Console.ReadLine();
                throw;
            }
        }
开发者ID:Azure-Samples,项目名称:storage-table-dotnet-getting-started,代码行数:38,代码来源:AdvancedSamples.cs


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