I have a pretty simple Linq to XML query:
var q = from c in xd.Descendants("PrimaryCategory")
where (int)xd.Element("PrimaryCategoryID") == 3
select new {campaignName = c.Element("CategoryList").Element("CategoryName").Value,
campaignURL = c.Element("CategoryList").Element("CategoryURL").Value};
This does fine for pulling the categoryname and the categoryURL from the first CategoryList element of the PrimaryCategoryID 3. The only problem is that there are multiple CategoryList nodes in the PrimaryCategory and I need it to return an enumerable list of objects with all of the Names and URLs in.
What am I doing wrong?