There is an object in the database type
class Node { public int Id public int ParentId public Node ParentNode public IEnumerable<Node> Childrens } It is necessary to get a flat list (array) of all children (and children of children, etc.) of the node.