I have the next snippet of code in C#:
var results = from g in this.context.MyStorageEventTable
where g.PartitionKey == partitionKey
&& g.EventType == "MyEvent"
select g;
var ev = results.FirstOrDefault();
which makes a consult to an Azure Table. This table contains more than 20000 entities. The problem is that sometimes the variable ev has a null value, and sometimes has the entity object. This occurs randomly. I know that the object exists in the table, so the null value is the wrong behavior. Why is this happening? Thank you!
Try results.AsTableServiceQuery().FirstOrDefault(). If that works, the problem was that a continuation token was coming back with the query, indicating there's more data, but you weren't issuing a followup query to follow that continuation token and get the rest of the data. You should just always use AsTableServiceQuery() to get continuation-token following for free.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With