Same table relationship in Entity Framework

前端 未结 2 1500
耶瑟儿~
耶瑟儿~ 2020-12-30 09:55

Is it possible to have an association mapping a table to itself?

e.g.

Table:  
ConditionId  
ConditionName 
... 
...  
ParentConditionId
         


        
2条回答
  •  南笙
    南笙 (楼主)
    2020-12-30 10:30

    Yes it is possible. Put the FK in your database and the wizard will map it correctly. Make sure ParentConditionId is nullable.

提交回复
热议问题