I building an application based on Azure and I would like to get the columns specification of the entity saved into a table storage before show them.
How can I do that?
I building an application based on Azure and I would like to get the columns specification of the entity saved into a table storage before show them.
How can I do that?
Try this code:
static void GetAttributeTypes()
{
storageAccount = CloudStorageAccount.DevelopmentStorageAccount;
var table = storageAccount.CreateCloudTableClient().GetTableReference("WADLogsTable");
var query = new TableQuery().Take(1);
var result = table.ExecuteQuery(query).ToList();
if (result != null && result.Count > 0)
{
var dynamicTableEntity = result[0];
foreach (var property in dynamicTableEntity.Properties)
{
Console.WriteLine(property.Key + " = " + property.Value.PropertyType);
}
}
}
Assuming all entities in a table have same attributes, what I have done is fetched just one entity from the table and looped over its properties. I have used Storage Client library 2.0.6.1.