How should I model friendships between users with EF code first?

前端 未结 2 1752
逝去的感伤
逝去的感伤 2021-01-20 01:06

I\'m tring to figure out how to represent friendships between users with Entity Framework (5) Code First. My initial idea was to create a class Friendship which contains ref

2条回答
  •  借酒劲吻你
    2021-01-20 02:08

    You could define the foreign keys yourself or remove cascade delete, depending on your scenario. See this related question : Entity Framework Code First: FOREIGN KEY constraint may cause cycles or multiple cascade paths

提交回复
热议问题