AccidentalFish.ApplicationSupport.Powershell.NewApplicationResources.UploadTableData C# (CSharp) Method

UploadTableData() private method

private UploadTableData ( Microsoft.WindowsAzure.Storage.Table.CloudTable table, System.Xml.Linq.XDocument document ) : void
table Microsoft.WindowsAzure.Storage.Table.CloudTable
document System.Xml.Linq.XDocument
return void
        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));
            }
        }