.net - 如何检查 Azure.Data.Tables 中是否存在表(v 12.5.0)

标签 .net azure cloud

我的数据读取代码(当前使用 Microsoft.Azure.Cosmos.Table)调用一个简单的方法来检查表是否存在;然后据此做出决策。 (如果表不存在,我不想创建它;我只是在这里阅读。)

如何在我们现在敦促迁移到的 Azure.Data.Tables 中执行相同的操作?

最佳答案

根据christothes的建议:

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;
}

引用文献:Migration guide from Microsoft.Azure.Cosmos.Table to Azure.Data.TablesTables migration guide should provide more context on the omission of the Exists method

关于.net - 如何检查 Azure.Data.Tables 中是否存在表(v 12.5.0),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72014909/

相关文章:

c# - 条件变量的 TPL 等价物是什么?

security - SQL Azure 是否兼容 PCI-DSS?

Azure 开放 AI 模型产生意外响应

python - 如何使用 Python Azure 文本转语音 api 生成 mp3 文件

java - 云 : Amazon, Google、Microsoft - 我可以使用哪种框架?

ubuntu - 在 cloud init runcmd 中使用管道失败

C#/WinAPI - 监视内存区域

.net - 当列在运行时排序时,DataGridView 行标题编号消失

c# - 如何将 HTTP header 添加到 Web 服务调用?

java - 我可以在 Azure 上为 Java 应用服务实现无代码 Application Insights 吗?