实体框架:每个类型的混合表和每个层次结构的表 [英] Entity Framework: mix table per type and table per hierarchy

查看:132
本文介绍了实体框架:每个类型的混合表和每个层次结构的表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的数据库中有两个表:

I have two tables in my database:


  • BaseEntity

  • 基金

基金实体从BaseEtity继承每种类型的表格。

The "Fund" entity inherits from "BaseEtity" with "table per type".

在我的商业模式中,我有不同类型的基金:

In my business model I have different types of "Fund":


  • Head-Fund

  • 直接投资基金

  • 等。

我想为那些人设立不同的实体具有每个层次结构的表的类型,这意味着我仍然只有一个带有类型鉴别器列的基金表。

I would like to have different entities for those types with "table per hierarchy", meaning that I still only have one "Fund" table with a type-discriminator column.

有没有办法让每个表层次结构在一个从基类派生的每种类型的表?

Is there a way to have "table per hierarchy" on an entity that derives from a base class with "table per type"?

推荐答案

这是不可能的,看到这个帖子供参考:

It is not possible, see this post for reference:

我可以在实体框架中为每个层次结构和每种类型的表混合表吗?

这篇关于实体框架:每个类型的混合表和每个层次结构的表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆