TreeView recursive data binding
description
It looks like that there is an error for the situation when we map same type to its own children.
For example, for type of sort :
public class Category
{
string Name;
Category parent;
IList<Category> Children;
}
when we map
mappings.For<Category>(x => x.ItemDataBound((control, item) =>
{
control.Text = item.Name;
}).Children(category => category.Children));
we get StackOverflowException, even though collection of categories itself may be perfectly valid tree (for example, even when Children collection for each passed element is empty).
For different types, mapping works well, but not for the same type as it looks like.