I've got a simple class defined as:
public class MyClass
{
//Some properties
public List<MyClass> SubEntries { get; set; }
//Some more properties
}
In another class I have a list of the above type. At the moment, I'm having a serious mental block. I just need to itereate through the list and count all occurances of MyClass. Since the SubEntries property can contain 0 or more entries which can themselves contain 0 or more entries, it strikes me that I need some sort of recursice method, unless LINQ provides a mechanism to do this.
Any help releasing this mental log jam would be appreciated.