azure - 如何使用 Microsoft.WindowsAzure.Storage.Table 的 TableOperators.Not 运算符

标签 azure azure-storage azure-table-storage azure-tablequery

我正在使用 Microsoft.WindowsAzure.Storage.Table 的 TableOperators 生成表查询并使用 TableQuery.CombineFilters 组合子句。但我没有看到使用“TableOperators.Not”来否定子句的方法。怎么才能做到这一点?

最佳答案

首先,这 2 个运算符,例如 TableOperators.AndTableOperators.Or,可用于连接 2 个过滤器。因此,这 2 个运算符可以在 TableQuery.CombineFilters 中使用。

但是对于TableOperators.Not,它仅用于一个过滤器(对子句/过滤器取反)。它不能用于连接 2 个过滤器。因此它不能在需要 2 个过滤器的 TableQuery.CombineFilters 中使用。

如果你想使用TableOperators.Not,你应该直接在where子句中使用它,如下所示:

TableQuery<CustomerEntity> myquery = new TableQuery<CustomerEntity>()
                .Where(TableOperators.Not + "(Email eq '<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b7dec1d6d9ced6d9d086f7dfd8c3dad6dedb99d4d8da" rel="noreferrer noopener nofollow">[email protected]</a>')");

关于azure - 如何使用 Microsoft.WindowsAzure.Storage.Table 的 TableOperators.Not 运算符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63103477/

相关文章:

azure - 访问 Azure WebApp for Containers 中的容器文件

Azure函数表绑定(bind): How do I update a row?

azure - "Could not create SSL/TLS secure channel"自 POODLE 以来 Azure 存储 .NET API 错误

azure - 如何设置 Azure 存储模拟器以监听所有接口(interface)?

azure - 如何在 InsertOrReplace 中关闭回显?

azure - 如果 TableBatchOperation 的一项操作失败会发生什么情况?

azure - 将 PowerBI 连接到 Azure Data Lake Storage v2 (adls v2) 时;它给出错误 404 "The specified container does not exist"

azure - 将消息放入队列的代码(可能)有问题

azure - 没有选项将关联组添加到虚拟网络 azure

postgresql - Azure Postgresql 数据库诊断设置中看不到事件中心命名空间