简体   繁体   中英

How to list all tables with Azure.Data.Tables?

I used to be able to list all tables (Table Storage) using tableClient.ListTablesSegmentedAsync(); with package Microsoft.Azure.Cosmos.Table

However since it is deprecated and I want to use the recommended package Azure.Data.Tables I am missing the functionality to list all tables.

How is this achieveable now?

You can follow the sample here

/ Use the <see cref="TableServiceClient"> to query the service. Passing in OData filter strings is optional.

Pageable<TableItem> queryTableResults = serviceClient.Query(filter: $"TableName eq '{tableName}'");

Console.WriteLine("The following are the names of the tables in the query results:");

// Iterate the <see cref="Pageable"> in order to access queried tables.

foreach (TableItem table in queryTableResults)
{
    Console.WriteLine(table.Name);
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM