當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。