Click here to Skip to main content
15,794,593 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys,

I have a query called permissions which contains an object list that I extracted from a XML file.

Find below an example of the xml structure:
<permission id="1">
  <permission id="1.1" />
  <permission id="1.2">
    <permission id="1.2.1" />
    <permission id="1.2.2" />
  <permission id="1.3" />

As we can see I have to create a recursive query in order to extract the entire data. Now, I need to use that list to compare with a specific value inside another query. For example:
var query = (from x in items.Elements()
            where (permissions.Any(i => i.Id == x.Attribute("id").Value))
            select ......

The problem is Any<> operator just compare the value with the first level nodes of my list.

Does anyone know a different approach to solve this problem? I mean, how to get/compare the entire tree?

Thanks in advance!
Updated 10-Jun-10 10:50am

1 solution

There's very similar issue right here.You could follow thread suggestions for your problem too.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900