Comparison Operators (Table Storage Support)

[This is preliminary documentation and is subject to change.]

Table Storage supports a subset of the comparison operators that are provided by LINQ. The comparison operators are defined by the ExpressionType enumeration of the System.Linq.Expressions namespace.

You can use the comparison operators with the Where operator to construct query expressions.

For all property types, the following operators are supported:

  • Equal
  • GreaterThan
  • GreaterThanOrEqual
  • LessThan
  • LessThanOrEqual
  • NotEqual

Additionally, the following operators are supported for properties of type bool:

  • And
  • AndAlso
  • Not
  • Or

Note   Table Storage does not support wildcard queries. However, you can perform prefix matching by using the comparison operators listed above on the desired prefix. For example, to return entities beginning with the letter 'a', you can use an expression on the URI like this expression: value>='a'&&value<'b'. In a LINQ query, use the CompareTo method, such as CompareTo(someValue) >= 0.