简体   繁体   中英

How to handle entity casting errors with Azure Storage Table Service

I fear this might be quite the simple question, but honestly I've read the documentation and I don't understand.

When using an Azure Storage Table, I understand that I set a Partition and Row Key then pass in the object I want to have saved in the entity.

Now, these are my questions? Once the first object is set, can subsquent objects have different structure?

What if I don't know the structure of an entity. Can I use a URL to discover it?

Without using Azure Storage explorer, is there any way to retrieve the structure of objects on a list of entities?

Every row in an azure table can have a completely different type of object, so the answer to your 1st question is yes.

If you do not know the structure of the entity stored, then you can retrieve the entity as DynamicTableEntity . DynamicTableEntity comes with an EntityProperty dictionary. The key in the dictionary is the name of the property and the value is the EntityProperty . The EntityProperty contains both a PropertyType property and the actual value of the property from the original object. This should give you a good idea of the shape of the object that is written to table storage. There is no URL functionality to get the type.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM