Changing the type of an (Entity Framework) entity that is part of an inheritance hierarchy

前端 未结 2 1794
礼貌的吻别
礼貌的吻别 2020-12-06 18:42

I have an inheritance hierarchy with a base Employee entity and some descendent entities for specific employee types. I need to be able to convert a base Employee entity to

2条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-06 18:50

    Technically, you can achieve it by using the stored procedure. TPT does not support it.

    However, I totally agree with Craig. In classic programming book Design Patterns (Addison-Wesley Professional), authors discuss inheritance versus composition and conclude that one should "favor composition over inheritance."

提交回复
热议问题