请教一个关于entityframework codefirst方式继承的问题。
abstractentitybase{guididdatetimtecreatedatedatetimecreateuserUsermodifydateUsermodif...
abstract entitybase
{
guid id
datetimte createdate
datetime createuser
User modifydate
User modifyuser
}
user:entitybase
{
string name
string gender
}
在entitybasebase中引用user是不是不对啊。我这样写无法生成数据库,提示出错。 展开
{
guid id
datetimte createdate
datetime createuser
User modifydate
User modifyuser
}
user:entitybase
{
string name
string gender
}
在entitybasebase中引用user是不是不对啊。我这样写无法生成数据库,提示出错。 展开
1个回答
展开全部
三种方式都看下,再决定用哪种
--Table per Hierarchy (TPH): Enable polymorphism by denormalizing the SQL schema, and utilize a type discriminator column that holds type information.
--Table per Type (TPT): Represent "is a" (inheritance) relationships as "has a" (foreign key) relationships.
--Table per Concrete class (TPC): Discard polymorphism and inheritance relationships completely from the SQL schema.
--Table per Hierarchy (TPH): Enable polymorphism by denormalizing the SQL schema, and utilize a type discriminator column that holds type information.
--Table per Type (TPT): Represent "is a" (inheritance) relationships as "has a" (foreign key) relationships.
--Table per Concrete class (TPC): Discard polymorphism and inheritance relationships completely from the SQL schema.
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询