假设我有以下类
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中模拟这些实体?