This snippet is from this answer
var reports = from report in xml.Descendants("report")
where report.Element("name").Value.Contains("Adjustment Report")
select new {
Name = report.Element("name").Value,
Extension = report.Element("extension").Value,
FileType = report.Element("filetype").Value,
Fields = report.Elements("field")
.Select(f => new {
Name = f.Attribute("name").Value,
Type = f.Attribute("type").Value
}).ToArray()
};
For the life of me I cannot figure out the syntax for this part in vb.net:
Fields = report.Elements("field")
.Select(**f =>** new {
Name = f.Attribute("name").Value,
Type = f.Attribute("type").Value
}).ToArray()
What I'm trying to accomplish - my xml looks like this:
<items>
<item>
<id>data</id>
<foto>
<fotoname>img1.jpg</fotoname>
<fotoorder>1</fotoorder>
</foto>
<foto>
<fotoname>img2.jpg</fotoname>
<fotoorder>2</fotoorder>
</foto>
</item>
</items>
I need my object to have a List (or collection of any kind) of foto elements.