I'm developing an application, that allows using dictionaries (e.g. English - German or Country - Capital). There are just 2 very plain tables:
1) Dictionary:
int Id, string Title //PartitionKey="SomeConstString", Rowkey=Id.ToString()
2) Article:
int DictionaryId, string Word, string Meaning //PartitionKey="D" + DictionaryID, Rowkey=Word
I can add articles, but when trying to delete I get the following problem: in every dictionary one or two articles are not deleted. Instead I get ResourceNotFoundException. There is absolutely nothing special about those articles (e.g. Russia - Moscow).
When I try to add articles with same PartitionKey and RowKey I get EntityAlreadyExistsException. I installed "Cloud Storage Studio" and found out that those entities are really still in table. I tried to delete them manually but got the same ResourceNotFoundException
in storage studio that I was getting in code. So if I add 100 articles and then try to delete them (in code or in studio like Ctrl+A -> Delete), 99 (or sometimes 98) are deleted and others are not. I'm using development storage emulator. Here is how I remove
articles (I tried different approaches, result is still the same):
TableServiceContext tableServiceContext = tableClient.GetDataServiceContext();
string partitionKey = "D" + dictionaryID;
Article[]articles=tableServiceContext.CreateQuery<Article>articleTableName).Where(a=>a.PartitionKey==partitionKey).ToArray();
for (int i = 0; i<articles.Length; ++i)
tableServiceContext.DeleteObject(articles[i]);
tableServiceContext.SaveChanges();
Can anyone tell me what can possibly be wrong with this? I can attach a screenshot from storage studio if needed.
Update: Here is a screenshot. 
Only this one selected record is not deleted in this table. I really can't imagine, what is so special about it. I tried other dictionary and 2 articles were not deleted from it either. I tried using Detach, exception is then no longer thrown, but entity still
remains in the table. I can use IgnoreResourceNotFoundException=true, but it still won't remove the record. There is a possibility that I'll need to add an entity with same PK&RK in future and this will fail ('EntityAlreadyExists' exception)
Update2: works fine in cloud