How will "One to many" relation in the same table will be mapped?
I have a table that has a one to many relation within the same table.
Directory
DirID int PK
ParentID int FK
When I try to map(ORM) it using ado.net entity data model, I got the following:
Directory
DirID int
ParentID int
Directory1 collection<Directory>
Directory2 Directory
Why I can't get a list of directories in "ParentID" .. just like the resu开发者_StackOverflow社区lt I can get mapping two tables(with one to many relation between them)? and what that Directory2 reference is for?
Directory1
is the collection of children. Directory2
is a reference to the parent.
精彩评论