Hi - looking for best practice in converting a parent-child relationship using Linq to XML
In this case i have a Domain class which contains a Group[]
What I want to do is iterate over the Groups[] in d (domains) and create the XElements in one hit.
XElement _customers = new XElement("Domains",
from c in d
orderby c.id //descending
select new XElement("Domain",
// something like--> new XElement("Groups", c.id),
// loop through d.Group and add new XElement...
new XElement("id", c.id),
new XAttribute("name", c.name),
new XElement("ismanaged", c.IsManaged.ToString()
)));
Thanks in advance