You can create an associative model that has keys from the two entities:
public class AssociativeEntity
{
[Key]
public Guid AssociativeEntityId { get; set; }
public Guid Entity1Id { get; set; }
public Guid Entity2Id { get; set; }
[Display(Name = "Entity1", ResourceType = typeof(Resources.Language))]
public virtual Entity1 Entity1 { get; set; }
[Display(Name = "Entity2", ResourceType = typeof(Resources.Language))]
public virtual Entity2 Entity2 { get; set; }
}
Entity 1:
public class Entity1
{
[Key]
public Guid Entity1Id { get; set; }
/* Describe the other properties here */
[Display(Name = "AssociativeEntities", ResourceType = typeof(Resources.Language))]
public virtual ICollection<AssociativeEntity> AssociativeEntities { get; set; }
}
Entity 2:
public class Entity2
{
[Key]
public Guid Entity2Id { get; set; }
/* Describe the other properties here */
[Display(Name = "AssociativeEntities", ResourceType = typeof(Resources.Language))]
public virtual ICollection<AssociativeEntity> AssociativeEntities { get; set; }
}