Parenting a child with white NHibernate?

I would like to create a cascading tree / list of N children for this parent, where the child can also become a parent.

Given the following data structure:

CountryType = 1; ColorType = 3; StateType = 5
6,7,8 = {Can, US, Mex}
10, 11, 12 = {Red, White, Blue}
20,21,22 = {California, Florida, Alberta}

TreeID  ListTypeID  ParentTreeID           ListItemID   
1            1       Null                   6   (Canada is a Country)
2            1       Null                   7   (US is a Country)
3            1       Null                   8   (Mexico is a Country)
4            3       3                      10  (Mexico has Red)
5            3       3                      11  (Mexico has White)
6            5       1                      22  (Alberta is in Canada)
7            5       7                      20  (California is in US)
8            5       7                      21  (Florida is in US)
9            3       6                     10  (Alberta is Red)
10           3       6                    12  (Alberta is Blue)
11          3       2                      10  (US is Red)
12          3       2                      11  (Us is Blue)

How will this be displayed in Fluent NHibernate classes?

Some direction would be appreciated.

Thank.

+3
source share
2 answers

The tree effect is good, but in this case, the remote data model will work best.

, . , .

, , LinkedListItems, , - ParentID.

, , , 1.. *.

0

, TreeNode NodeType, Name ParentNode TreeNode.

node, TreeNode, node NodeType.

+1

Source: https://habr.com/ru/post/1781299/


All Articles