开发者

How will "One to many" relation in the same table will be mapped?

开发者 https://www.devze.com 2023-02-26 07:24 出处:网络
I have a table that has a one to many relation within the same table. Directory DirID int PK ParentID int FK

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

精彩评论

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