Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Empty table query against Azure Table Storage

I'm using Azure Table Storage. When I query a table that is empty with parameters other than PartitionKey and RowKey involved, I get an exception. When I have at least one row, the exception doesn't appear. If I query the empty table with just PartitionKey and RowKey, it is OK.

I certainly do not want to make an extra round trip to test if the table is empty. How do people normally solve this problem? Is there a performant way to quickly check if the table is empty?

I am using the development storage, as I just saw there are reported errors in this scenario with the development storage and the error goes away in production. However, I do not want to keep customized code just for development storage, is there a good way to get around this, so I could have the same code running local as well as in production cloud environment?

like image 708
Ray Avatar asked Dec 14 '25 10:12

Ray


1 Answers

I've got this around by setting DataServiceContext.IgnoreResoureNotFoundException property to true. Hope this helps others too.

like image 158
Ray Avatar answered Dec 17 '25 02:12

Ray



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!