Hi,
i have a data structure like this
public class Employee
{
public string Name { get; set; }
public IEnumerable<Employee> Employees { get; private set; }
// ...
}
Now i need to loop through the complete structure and execute a method on each item.
How can i create an extension on IEnumerable for such a traverse function.
Wonderfull would be something like this
employeList.Traverse(e => Save(e), e.Employees.Count > 0);
Or is it impossible and i have to create a special method in my business logic?
Thanks a lot.