Changing the type of an (Entity Framework) entity that is part of an inheritance hierarchy
.net, entity-framework, inheritance
Solution
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."
Problem
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 a more specific entity (e.g. TemporaryEmployee) and from a more specific type back to the base type (e.g. if an employee is no longer "temporary" then I want that instance to just be persisted as Employee. In the DB this is just a matter of adding or removing a row from the table for the specific subclass. (I'm using table per class.) I'm not seeing how to do this using EF calls though.