How do you deal with polymorphism in a database?

后端 未结 13 1191
小蘑菇
小蘑菇 2020-11-28 02:11

Example

I have Person, SpecialPerson, and User. Person and SpecialPerson are just people - they don\

13条回答
  •  悲哀的现实
    2020-11-28 03:00

    In the past I've done it exactly as you suggest -- have a Person table for common stuff, then SpecialPerson linked for the derived class. However, I'm re-thinking that, as Linq2Sql wants to have a field in the same table indicate the difference. I haven't looked at the entity model too much, though -- pretty sure that allows the other method.

提交回复
热议问题