开发者

Querying a collection of collection using Linq

开发者 https://www.devze.com 2023-04-11 10:28 出处:网络
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 fu

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);

0

精彩评论

暂无评论...
验证码 换一张
取 消