本文整理匯總了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 );
}
示例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;
}
示例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;
}
}