I have a recursive object, a linked list really:
public class LinkedList
{
public string UniqueKey { get; set; }
public LinkedList LinkedList { get; set; }
}
LinkedList will have some object graph that will eventually end in LinkedList.LinkedList == null.
I would like to take all the objects in the graph and put them into a LinkedList collection so that I can iterate over them. How do I do this in C#? I feel as if there's a really easy way of going about this using yield or Linq voodoo?