开发者

Query Azure Table Storage without LINQ

Is there a way to query Azure table Storage without linq?

I want to use >=, <=, <, > operattors on strings which of course linq will not allow me to do so.

For. eg: I cannot开发者_JAVA百科 execute below expression in linq as my PartitionKey is a string.

(PartitionKey ge 'A') and (PartitionKey le 'R')


You should be able to use something like PartitionKey.CompareTo(…) > 0 in linq. An alternative to linq would be to use a DataServiceQuery<T> and e.g. its AddQueryOption method, but that would leave you with the same limitations.


I'm not sure why that rest query doesn't work for you. I believe the CompareTo method basically generates that. There is even an example here:

Constructing Filter Strings for the Table Designer
http://msdn.microsoft.com/en-us/library/ff683669.aspx

Note that the Table service does not support wildcard queries, and they are not supported in the Table Designer either. However, you can perform prefix matching by using comparison operators on the desired prefix. The following example returns entities with a LastName property beginning with the letter 'A': LastName ge 'A' and LastName lt 'B'

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜