When I use the following code I get the same items multiple times.
XElement neededFiles = new XElement("needed",
from o in _9nFiles.Elements()
join t in addedToSitePull.Elements()
on o.Value equals
t.Value
where o.Value == t.Value
select new XElement("pic", o.Value));
I'd like to get only unique items.
I saw a post here that used and I tried to implement it, but the change had no affect
the post: http://stackoverflow.com/questions/3519165/how-can-i-do-select-unique-with-linq
The code:
XElement neededFiles = new XElement("needed",
(from o in _9nFiles.Elements()
join t in addedToSitePull.Elements()
on o.Value equals
t.Value
where o.Value == t.Value
select new XElement("pic", o.Value)).Distinct() );
Thanks Asaf