EF6仅包含基本(非派生类型)TPH

时间:2018-06-25 11:59:40

标签: c# entity-framework entity-framework-6

public class Transaction {
    //10 fields
    public Claim ClaimNavigate { get; set; }
}

public class Claim {
    //20 fields
}

public class Cms : Claim {
    //50 fields
}

public class Ub : Claim {
    //80 fields
}

dbContext.Transactions.Include(x => x.Claim).First()

dbContext.Claims.First()  // also returns all derived types, how to return Base only?

有没有一种方法可以只包含Claim的字段,而不是将所有继承的Claim的所有字段自动添加到sql中?

0 个答案:

没有答案