考虑以下实体模型:
public class Agreement : Entity
{
public int AgreementId { get; set; }
public virtual ICollection<Participant> Participants { get; set; }
}
public class Establishment : Entity
{
public int EstablishmentId { get; set; }
}
public class Participant : Entity
{
public int AgreementId { get; set; }
public virtual Agreement Agreement { get; set; }
public int EstablishmentId { get; set; }
public virtual Establishment { get; set; }
public bool IsOwner { get; set; }
} …Run Code Online (Sandbox Code Playgroud) entity-framework entity-framework-4 entity-framework-4.1 entity-framework-4.2