How can I set multiple filters on a Azure Table Storage?
This is what I\'ve tried:
string partitionFilter = TableQuery.GenerateFilterCondition(\"Partitio
How can I set multiple filters on a Azure Table Storage?
I was wondering the same thing. I wrote an extension to the TableQuery class which works fine.
It's an easy change which makes me wonder if we are going about querying with multiple filters incorrectly.
public static class TableQueryExtensions
{
public static TableQuery AndWhere(this TableQuery @this, string filter)
{
@this.FilterString = TableQuery.CombineFilters(@this.FilterString, TableOperators.And, filter);
return @this;
}
public static TableQuery OrWhere(this TableQuery @this, string filter)
{
@this.FilterString = TableQuery.CombineFilters(@this.FilterString, TableOperators.Or, filter);
return @this;
}
public static TableQuery NotWhere(this TableQuery @this, string filter)
{
@this.FilterString = TableQuery.CombineFilters(@this.FilterString, TableOperators.Not, filter);
return @this;
}
}