1
votes

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 execute below expression in linq as my PartitionKey is a string.

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

2 Answers

2
votes

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.

0
votes

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'