linq to xml check for duplicates, any equals



I have xml file



<Nodes>
<Node> one </Node>
<Node> two </Node>
<Node> three </Node>
</Nodes>


inside method I'm receving list of nodes to append into file, so I want to check is there duplicates



public static void AppendToXmlFile(List<string> passedNodes)
{
bool duplicates = passedNodes.Any(x=>x.Equals(doc.Element("Nodes")
.Descendants("Node")
.Select(a=>a.Value)));
...
}

this query always returns false.

Tiada ulasan:

Catat Ulasan