將屬性添加到 Azure 表存儲中的實體似乎會將空屬性添加到表中的所有實體 (Adding property to entity in Azure Table Storage seems to add null property to all entities in table)


問題描述

將屬性添加到 Azure 表存儲中的實體似乎會將空屬性添加到表中的所有實體 (Adding property to entity in Azure Table Storage seems to add null property to all entities in table)

I'm trying to dynamically add properties to Azure Table Storage using the ReadingEntity and WritingEntity events, as described here: How to add new properties to an entity saved in Azure Table Storage?. 

The purpose is to save a List property on my poco into table storage. To accomplish this, every time I need to add a new item to the list for an entity, I'm getting that entity out of Table Storage, counting the number of properties with a certain name that the entity has, and then adding another one with the same name and an incremented index at the end - for example, if an entity has properties Friend1, Friend2, and Friend3, I will add Friend4. 

The problem I'm hitting is that when I add a property to 1 entity, it seems to add it to all entities in the table (or maybe the partition - I haven't checked). So if I add Friend1 to Entity1, and then add a Friend property to Entity2, I'm expecting to add Entity2.Friend1. Instead, Friend1 seems to already exist on Entity2, with a NULL value. So the code that adds the property sees Friend1 already there, and adds a Friend2 property to Entity2. As if this were a relational database and I'm creating a column in the schema. Obviously this totally destroys my plans for how to store this info ...

Is this how it's supposed to work?? I was working with the understanding that properties could be unique to each entity. 

Thanks!


參考解法

方法 1:

Gaurav and smarx were right - the problem goes away when using the Table Storage Service and not the local storage service emulator. 

(by Andrew B SchultzAndrew B Schultz)

參考文件

  1. Adding property to entity in Azure Table Storage seems to add null property to all entities in table (CC BY-SA 3.0/4.0)

#azure #azure-table-storage






相關問題

將屬性添加到 Azure 表存儲中的實體似乎會將空屬性添加到表中的所有實體 (Adding property to entity in Azure Table Storage seems to add null property to all entities in table)

帶有 Azure WCF 服務的 Windows 8 應用 (Windows 8 App with Azure WCF Service)

當我嘗試查看連接到 TFS 的網站的部署選項卡時,無法檢索部署歷史記錄 (Failed to retrieve deployment history when I try to view the deployment tab of a web site connected to TFS)

是否可以在單個 Azure 項目中同時使用 New Relic 和 Azure Application Insights? (Is it possible to use both New Relic and Azure Application Insights together in single Azure project?)

有沒有辦法從 Azure 中獲取所有 DocumentDb 資源? (Is there a way to fetch all DocumentDb resoruces from Azure?)

Azure Search .Net SDK 中的複雜類型支持 (Complex Types support in Azure Search .Net SDK)

遠程服務器返回錯誤:(400) 錯誤請求。在 C:\Program Files\WindowsPowerShell\Modules\CosmosDB\3.1.0.293\CosmosDB.psm1 (The remote server returned an error: (400) Bad Request. At C:\Program Files\WindowsPowerShell\Modules\CosmosDB\3.1.0.293\CosmosDB.psm1)

如何從狀態“False(MissingEndpoints)”啟用 kube-system/metrics-server? (How to enable kube-system/metrics-server from status "False (MissingEndpoints)"?)

通過 smtp 從安裝為 azure 中的 IaaS 的服務器發送電子郵件 (sending emails via smtp from a server installed as IaaS in azure)

cosmosDB RU 吞吐量如何強制執行 (How is cosmosDB RU throughput enforced)

在使用 azure 流量管理器和 azure 應用程序網關與 WAF 時實現國家級阻止 (Achieve country level blocking while using azure traffic manager and azure application gateway with WAF)

Azure 計算機視覺將圖像旋轉 180 度 (Azure Computer Vision Rotating the image By 180 degrees)







留言討論