1

I am using Microsoft.WindowsAzure.Storage.Table's TableOperators to generate table queries and combining clauses using TableQuery.CombineFilters. But I do not see a way to use 'TableOperators.Not' to take negation of a clause. How can that be done?

Ivan Glasenberg
  • 29,865
  • 2
  • 44
  • 60
Sayantan Ghosh
  • 998
  • 2
  • 9
  • 29

1 Answers1

1

First of all, these 2 operators like TableOperators.And and TableOperators.Or, which can be used to concatenate 2 filters. So these 2 operators can be used within TableQuery.CombineFilters.

But for TableOperators.Not, which is just used for only one filter(take negation of the clause/filter). It cannot be used to concatenate 2 filters. So it cannot be used within TableQuery.CombineFilters which needs 2 filters.

If you want to use the TableOperators.Not, you should directly use it in the where clause, like below:

TableQuery<CustomerEntity> myquery = new TableQuery<CustomerEntity>()
                .Where(TableOperators.Not + "(Email eq 'ivanyang1@hotmail.com')");
Ivan Glasenberg
  • 29,865
  • 2
  • 44
  • 60