本文整理汇总了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;
}
}