c# - EF Code First Flexible Relationships -


i'm trying set flexible one-to-many relationship in ef. imagine have following poco classes:

public class entitya {     public guid id { get; set; }     public virtual ienumerable<event> events { get; set; } }  public class entityb {     public guid id { get; set; }     public virtual ienumerable<event> events { get; set; } }  public class event {     public guid id { get; set; }     public guid entityid { get; set; } } 

i want event class link either entity through entityid propery. it's not normal one-to-many relationship.

i don't need relationship properties on event side, there ienumerable<event> events property in each of 2 entity classes, allow me grab list of linked events entity choose.

i'm using entitytypeconfiguration<t> maps need working out relationships on this.


Comments