简体   繁体   中英

Deserialize a DynamicTableEntity retrieved from Azure Table

I want to print a DynamicTableEntity object retrieved from an Azure Table. I am not aware of the properties of the retrieved object.

I am getting an error in using Newtonsoft.Json

var toreturn = JsonConvert.SerializeObject(retrievedEntitity);

"Error getting value from 'BinaryValue' on 'Microsoft.WindowsAzure.Storage.Table.EntityProperty'."

How can I serialize retrievedEntity of type DynamicTableEntity?

How can I serialize retrievedEntity of type DynamicTableEntity?

It can be done by DynamicTableEntityJsonSerializer .

//Instantiate serializer
var serializer = new DynamicTableEntityJsonSerializer.DynamicTableEntityJsonSerializer();

//Serialize DynamicTableEntity into Json string
var serializedEntity = serializer.Serialize(dynamicTableEntity);

Test Result:

在此处输入图片说明

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