I am trying to use EF Code first to create a database but I am not sure how to define the classes for the following relationship so that it is efficient.
We have a User and User has Friends, which in turn is a collection of User, so I was thinking of the following POCO Class
`//Class User
public class User
{
public Guid UserId{get;set;}
public string UserName{get;set;}
public String UserAddress{get;set;}
// other user properties
}
//Class Friend
public class Friend
{
public Guid FriendId{get;set;} //unique identifier for Friend Table
public virtual User CurrentUser{get;set;}
public List<User> lstUserFriends {get;set;} //contains list of all friends that the user has
}`
Does this look good performance-wise or do you think you can suggest an alternative?