我正在使用 Microsoft.WindowsAzure.Storage.Table
的 TableOperators 生成表查询并使用 TableQuery.CombineFilters
组合子句。但我没有看到使用“TableOperators.Not”来否定子句的方法。怎么才能做到这一点?
最佳答案
首先,这 2 个运算符,例如 TableOperators.And
和 TableOperators.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/