How do you represent a many-to-many relationship in the EF4 Code-First CTP3?
For example if I have the following classes:
class User
{
public int Id { get; set; }
public string Name { get; set; }
public ICollection<Profile> Profiles { get; set; }
}
class Profile
{
public int Id { get; set; }
public string Name { get; set; }
}
In the database there is a UserProfiles table that has the FK for User and FK for Profile. How can I map this?
EDIT: I understand how to to currently map with having a ICollection<User>
property on the Profile
, but I really don't want to have a an opposite navigation property when it should be "Users have many profiles".