score:1

Accepted answer

The first select new .. into x I don't see why you need, try removing it and write group node by new...

"from...from" is written as a lambda expression like this:

Categories.SelectMany(n => Categories, (n, p) => new { Node = n, Parent = p });

Related Query