Click here to Skip to main content
15,878,814 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello guys,

I'm making a mini social network to learn MVC and EF.
So, a user can add other users

My question is:
- I create a new model UserFriend and i use like this:
C#
public class UserFriendCollection : Collection<UserFriend> { }
 public class UserFriend
 {
    public int UserFriendID {get;set;}
    ...
 }

   public class ApplicationUser : IdentityUser
   {
       public UserFriendCollection Friends { get; set; }
       public string FirstName { get; set; }
       public string LastName { get; set; }
       public string Email { get; set; }
   }


or

- I use the same model IdentityUser , like this:
C#
public class ApplicationUserCollection : Collection<ApplicationUser> { }

   public class ApplicationUser : IdentityUser
   {
       public ApplicationUserCollection Friends { get; set; }
       public string FirstName { get; set; }
       public string LastName { get; set; }
       public string Email { get; set; }
   }



thankss
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900