문제

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