I have very big table in my Database and a can't modify it. So i have BaseEntity type for table.

I have several children (entity1, entity2) and i'd like to map each type to same column ("Date") and name properties differently.

Surely i can't move all same column properties to base type cause there is about 100 columns in my super table (it's not my design i've jst need to map it)

So i have 0019 error and is there any way to solve it or EF not for me?

有帮助吗?

解决方案

No. TPH requires that each property defined in derived entity is exclusive for that entity (no other entity can map to the same column). This targets more general rule in EF - each column can be mapped only once. So if you need to use some column in more entities it must be defined in parent and must have same name in all child entities.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top