LINQ: Selecting "Deep" in a hierarchical object? Selecting all childs that have the same parent? -


can help?

i have class file called member stores object reference , object reference of parent. have list contains "many" members. flat file system, works great linq can see give me childs has parent of x. using object reference field of parent property.

now thinking of recreating class file , adding new field hold list of member , remove parent property - way have 1 object there other objects object. hope makes sense? :-)

so if have new object, how use linq childs of specific parent? direct descendent? , possible flatten file i.e return items single objects part of list.

i love hear anyones comments on method better, i.e. have , hierarchy approach.

thanks in advance

anytime hierarchical collections, remember there multiple different data structures handle type of problem. there 1 that's rather complex, provides amazing performance. consists of dictionary keyed off integers containing entire collection. objects keep parent relationship, , have hashset children collection that's lazy loaded. allows collection of parents or children object @ level of tree.

the comments correct though. without samel code, can't give example of how look. theoretical.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -