开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜