Reputation: 5887
<field name="value" value="A" />
<field name="value" value="B" />
<field name="text" value="C" />
<field name="text" value="D" />
<field name="key" value="E" />
When I filter I need to get one element for "value", one element for "text" and one element for "key" (Yes, "key" has only one element and it should be returned)
I tried
elements.Select(item=>item.Attribute("name")).Distinct();
This returns only the XAttribute but I need the entire XElement.
Upvotes: 1
Views: 662