Using EF5 and migrations. I want to add a property to my join table ProjectUser. I set up the models as below, but the migration does not generate the property. Thanks or ideas were be greatly appreciated.
User {
public int UserGuid { get; set; }
....
public virtual IColllection<Project> Projects { get; set; }
}
Project {
public int ProjectId { get; set; }
....
public virual ICollection<User> Contacts { get; set; }
}
ProjectUser {
public int Project_ProjectId { get; set; }
public guid User_UserGuid { get; set; }
public string ProjectRoles { get; set; }
}
Did you remember to add ProjectUser to the DbContext? You also need to make your User and Project collections refer to the join table, not each other. EF doesn’t natively support many to many relationships with payload.
How do you think you would be able to access the ProjectRoles property?