假设我有以下实体:
public partial class Store
{
public Store()
{
this.ConglomeratesByField1 = new HashSet<Conglomerate>();
this.ConglomeratesByField2 = new HashSet<Conglomerate>();
}
[Key]
public int ID_Store { get; set; }
public string StoreName { get; set; }
[ForeignKey("ID_Store1")]
public virtual ICollection<Conglomerate> ConglomeratesByField1 { get; set; }
[ForeignKey("ID_Store2")]
public virtual ICollection<Conglomerate> ConglomeratesByField2 { get; set; }
}
使用代码优先,是否有可能拥有一个“Conglomerates”属性,它将成为 ConglomeratesByField1 和 ConglomeratesByField2 的“联合”,或者我必须使用专门的方法扩展类?