Querying a collection of collection using Linq
I have a nested collection of collection of array that can go to any level I have to query based on a particular id and get the detai开发者_运维问答ls of that array.
Sounds like you need a recursive function. I wrote an extension method to IEnumerable
called SelectRecursive
on codeproject a while ago:
http://www.codeproject.com/Tips/80746/Select-Recursive-Extension-method
Usage: var allChildren = node.ChildNodes.SelectRecursive(n => n.ChildNodes);
精彩评论