var resultsVar = from di in resultsDoc.Descendants("result")
let items = di.Elements("item")
select new {
ColumnName = (
from item in items
where "COLL_NAME".Equals(item.Element("name").Value)
select item.Element("value").Value).First(),
Description = (
from item in items
where "DESCRIPTION".Equals(item.Element("name").Value)
select item.Element("value").Value).First()
};
(I am also not using the anonymous type -- rather I am actually populating object fields).
I have not done too much testing on performance but it seems to be reasonable.
Thank you both for your help. LINQ is slowly begining to make sense to me, and while am still a little frustrated with it (the syntax can be rather irritating in VS because of its indention rules) I am beginning to see how it can be used effectively.

New Topic/Question
Reply





MultiQuote


|