实体框架继承:TPT,TPH还是无? [英] Entity Framework inheritance: TPT, TPH or none?

查看:149
本文介绍了实体框架继承:TPT,TPH还是无?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读有关使用实体框架继承的可能性。有时候我使用一个意见来输入数据记录,我不知道我是否会使用TPT或TPH或者没有...

I am currently reading about the possibility about using inheritance with Entity Framework. Sometimes I use a approch to type data records and I am not sure if I would use TPT or TPH or none...

例如...
我有一个电子商务商店,添加运费,帐单和送货地址

For example... I have a ecommerce shop which adds shipping, billing, and delivery address

我有一个地址表:

RecordID
AddressTypeID
Street
ZipCode
City
Country

和一个表 AddressType

RecordID
AddressTypeDescription

表格设计与gerneral设计不同,当人们炫耀TPT或TPH ...
当有这样一种方法时,考虑继承是有道理的。

The table design differs to the gerneral design when people show off TPT or TPH... Does it make sense to think about inheritance an when having a approach like this..

我希望它是有道理的。 ..

I hope it makes sense...

感谢任何帮助...

推荐答案

你应该查看我的 EF Tips系列

一个叫如何选择继承策略应该给你更多的洞察力

The one called How to choose an inheritance strategy should give you some more insight

希望这有助于

Alex

这篇关于实体框架继承:TPT,TPH还是无?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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