score:3
Accepted answer
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);
Source: stackoverflow.com
Related Query
- NHibernate querying on a string collection using Linq results in either error or empty collection
- Querying a collection of collection using Linq
- When querying a collection using linq it always returns a null
- When querying a collection using linq it always returns a null
- Querying the database using EF Code First and Linq
- Update all objects in a collection using LINQ
- Convert string[] to int[] in one line of code using LINQ
- How to remove duplicates from collection using IEqualityComparer, LinQ Distinct
- Using LINQ to Objects to find items in one collection that do not match another
- Collection to string using linq
- Query and updating a property in a collection using LINQ
- Using Linq to find the element after a specified element in a collection
- Getting a collection of index values using a LINQ query
- Get new indices of items in a collection after sorting using LINQ
- Using Linq to run a method on a collection of objects?
- How to add an item in a collection using Linq and C#
- Appending an element to a collection using LINQ
- Select object from nested collection using Linq
- LINQ WHERE method alters source collection
- Using LINQ to generate a random size collection filled with random numbers
- Counting words in a collection using LINQ
- Using LINQ to find all keys from one collection that are not in another?
- LInq querying collection inside collection
- using LINQ how can i concatenate string properties from itesm in a collection
- Left outer join using LINQ -- understanding the code
- How to reuse a linq expression for 'Where' when using multiple source tables
- Sort collection within collection using Linq
- Avoiding code repetition when using LINQ
- Using LINQ to delete an element from a ObservableCollection Source
- Querying elastic search with linq using NEST
More Query from same tag
- Linq group with min date and count on join
- Linq result as collection of parent (User) object
- Type.GetProperties different properties between Collection and ICollection
- Linq to SQL: Equivalent of Array.SequenceEqual
- Get count from join table - EFCodeFirst
- LinQ query Simple Where clause and many filter criteria
- Performance issue in IEnumerable type when querying large amount of data with LINQ
- Use one variable in multiple chained LINQ queries
- LINQ syntax - ordering of criteria
- Remove XML Tag using linq c#
- Which is the most efficient DataSet query operation?
- How to optimize this expression ? LINQ?
- List<string[]> determine max length by Linq
- linq count returns 0 if the group by column is 0
- Linq DataTable Having Query
- The type or namespace name 'Linq' does not exist in the namespace 'System'
- Problem with insert in db with ASP.NET
- Which one of this syntaxs have better performance?
- How do I determine the source of unpredictable LINQ query results?
- Define last index of element in text with linq
- Is there a LINQ alternative operator to Where() operator with List.Contains() method inside
- How to create a dictionary from a list with an object as key
- Populating a List(Of String) from a Datatable using LINQ in VB.NET
- C# LINQ DataTable "WHERE NOT IN"
- Select one table column with distinct record with other table all data
- Need to get the sum from the joined column in LINQ
- Linq and returning types
- Use Linq instead of Icomparable
- Change the order of List items conditionally with LINQ
- Linq method to transform nulls into empty IEnumerable<T>?