Multiple filter conditions Azure table storage

后端 未结 5 758
半阙折子戏
半阙折子戏 2021-02-02 06:43

How can I set multiple filters on a Azure Table Storage?

This is what I\'ve tried:

string partitionFilter = TableQuery.GenerateFilterCondition(\"Partitio         


        
5条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-02 07:20

    First "and" your partition filter with one of the date filters, then "and" the intermediate result with the other date filter.

    string date1 = TableQuery.GenerateFilterConditionForDate(
                       "Date", QueryComparisons.GreaterThanOrEqual,
                       DateTimeOffsetVal);
    string date2 = TableQuery.GenerateFilterConditionForDate(
                       "Date", QueryComparisons.LessThanOrEqual,
                       DateTimeOffsetVal);
    string finalFilter = TableQuery.CombineFilters(
                            TableQuery.CombineFilters(
                                partitionFilter,
                                TableOperators.And,
                                date1),
                            TableOperators.And, date2);
    

提交回复
热议问题