EF 6:两个相同类型的集合

时间:2018-05-31 16:46:05

标签: entity-framework entity-framework-6

假设我有以下类

public class Activity
{
    [Key]
    public int ActivityId { get; set;} 

    public virtual ICollection<ActivityConstraint> CreationConstraints { get; set; }

    public virtual ICollection<ActivityConstraint> ExecutionConstraints { get; set; }
}

public class ActivityConstraint
{
    [Key]
    public int ActivityConstraintId { get; set;} 

    [ForeignKey("Activity")]
    public virtual Activity Activity { get; set; }
}

我如何在EF 6中模拟这些实体?

0 个答案:

没有答案