My data-reading code (currently using Microsoft.Azure.Cosmos.Table) calls a simple method to check to see if a table exists or not; it then make decisions based on that. (I don't want to create the table if it doesn't exist; I'm just reading here.)
How to do the same thing in Azure.Data.Tables, to which we are now urged to migrate?
CodePudding user response:
As suggested by christothes:
- You can use
TableServiceClient.Query
method.
a simple method to check to see if a table exists or not; it then make decisions based on that. (I don't want to create the table if it doesn't exist; I'm just reading here.)
bool exists = false;
await foreach(var tbl in service.QueryAsync(t => t.Name == "mytable"))
{
exists = true;
}
References: Migration guide from Microsoft.Azure.Cosmos.Table to Azure.Data.Tables and Tables migration guide should provide more context on the omission of the Exists method