I've got the following snippet of code:
var dataSet = new DataSet("Data");
var table = GetCustomerTable();
var orgTable = GetOrganizationTable();
dataSet.Tables.Add(table);
dataSet.Tables.Add(orgTable);
var relation = new DataRelation("CustomerMembership", dataSet.Tables["Customers"].Columns["CustomerId"], dataSet.Tables["Organizations"].Columns["CustomerId"])
{Nested = true};
dataSet.Relations.Add(relation);
dataSet.WriteXml(@"C:\MyFeed.xml");
Which gives me the following result:
<Customers>
<CustomerId>272408857</CustomerId>
<snip>
<Organizations>
<OrganizationName>Org1</OrganizationName>
</Organizations>
<Organizations>
<OrganizationName>Org2</OrganizationName>
</Organizations>
</Customers>
What I'm looking for is something like this:
<Customers>
<CustomerId>272408857</CustomerId>
<snip>
<Organizations>
<OrganizationName>Org1</OrganizationName>
<OrganizationName>Org2</OrganizationName>
</Organizations>
</Customers>
Any ideas on how I can get OrganizationName
nested inside of one Organization
node; instead of having 2 nodes with one value each?