相关疑难解决方法(0)

如何在TPH TPT对象之间映射外键 - 实体框架代码优先

我们有以下一组对象.

public class Form
{
    public int FormId { get; set; }
    public DateTime DateCreatedOn { get; set; }
    public string Status { get; set; }
}

// This is using TPT inheritance from Form
[Table("FormA")]
public class FormA : Form
{
    public string ExtraInfoA { get; set; }
    public virtual ICollection<Child> Children
}

// This is using TPT inheritance from Form
[Table("FormB")]
public class FormB : Form
{
    public string ExtraInfoB { get; set; }
    public virtual ICollection<Adult> Adults …
Run Code Online (Sandbox Code Playgroud)

entity-framework ef-code-first entity-framework-4.3

3
推荐指数
1
解决办法
2076
查看次数