Assume I have the following XML file:
<Movies>
<Movie ownerName="Ryan">
<Title>The Lord of the Rings Trilogy</Title>
<Title>Saving Private Ryan</Title>
<Title>etc</Title>
</Movie>
<Movie ownerName="Rynina">
<Title>Foo</Title>
<Title>Bar</Title>
</Movie>
</Movies>
What I'm after is using Linq to Xml to retrieve classes of type MovieCollection. MovieCollection has two properties, OwnerName (String) and Movies (List(Of String)).
Generally, I'd do something like:
From entry in movies...<Movie>_
Select New MovieCollection With { _
.OwnerName = [email protected], _
.MovieCollection = entry.<Title>.Value}
However in this case this obviously wont work. Is there anyway to fill the MovieCollection list with all the movies that occur for that owner using Linq?