It is necessary to organize the logic of the user's friends in the social network. Finally confused.

public class Friendlist : EntityBase //от EntityBase наследуется Id { //ссылка на владельца списка друзей public virtual User FriendOwner { get; set; } //список друзей public virtual ICollection<User> UsersFriends { get; set; } } public class FriendRequests : EntityBase { //ссылка на владельца списка заявок public virtual User RequestsOwner { get; set; } //список заявок public virtual ICollection<User> UsersRequests { get; set; } } 

User will store

 public virtual ICollection<User> Friends { get; set; } public virtual ICollection<User> Requests{get; set;} 

or just two type links? Here it is not at all clear

 public virtual Friendlist Friends { get; set;} public virtual FriendRequests Requests{ get; set;} 

Migration in this case has the form, the code is closed, for the case when User stores links, and not collections:

 public override void Up() { Database.AddTable( "FriendLists", new Column("Id", DbType.Int64, ColumnProperty.PrimaryKeyWithIdentity), new Column("FriendsOwner_Id", DbType.Int64, 30, ColumnProperty.ForeignKey)); Database.AddTable( "FriendRequests", new Column("Id", DbType.Int64, ColumnProperty.PrimaryKeyWithIdentity), new Column("FriendRequestsOwner_Id", DbType.Int64, 30, ColumnProperty.ForeignKey)); //Database.AddForeignKey("FK_Users_FriendList_Friends", "Users", "Friendlist_Id", "FriendList", "Id"); //Database.AddForeignKey("FK_Users_FriendRequests_Requests", "Users", "Friendrequests_Id", "FriendRequests", "Id"); Database.AddForeignKey("FK_FriendList_Users_FriendsOwner", "FriendList", "FriendsOwner_Id", "Users", "Id"); Database.AddForeignKey("FK_FriendRequests_Users_FriendRequestsOwner", "FriendRequests", "FriendRequestsOwner_Id", "Users", "Id"); } 

    0