Hi all, I need return a list of the element <AssetText>
. My query below only returns back the first AssetText
. Any thoughts much appreciated.
var q = from c in xDoc.Descendants("Product")
where (int) c.Element("ProductView").Element("ViewId") == 44
select (string) c.Element("ProductView").Element("AssetText").Element("Text");
<Product>
<ProductView>
<ViewId>44</ViewId>
<AssetText>
<Text>my first Asset Text</Text>
</AssetText>
<AssetText>
<Text>my second Asset Text</Text>
</AssetText>
</ProductView>
<ProductView>
<ViewId>45</ViewId>
<AssetText>
<Text>my third Asset Text</Text>
</AssetText>
</ProductView>
</Product>