private void UploadTableData(CloudTable table, XDocument document)
{
foreach (XElement xEntity in document.Root.Elements("entity"))
{
string partitionKey = xEntity.Element("PartitionKey").Value;
XElement xRowKey = xEntity.Element("RowKey");
string rowKey = xRowKey != null ? xRowKey.Value : "";
DynamicTableEntity tableEntity = new DynamicTableEntity(partitionKey, rowKey);
foreach (XElement xProperty in xEntity.Elements())
{
if (xProperty.Name != "PartitionKey" && xProperty.Name != "RowKey")
{
EntityProperty property = GetEntityProperty(xProperty);
tableEntity[xProperty.Name.LocalName] = property;
}
}
table.Execute(TableOperation.InsertOrReplace(tableEntity));
}
}