0

Basically, I have two EF classes (mapped to the database) in a TPT architecture:

// Gets mapped to a table called "People".
public class Person { public Guid Id { get; set; } }
// Gets mapped to a table called "People_Student".
public class Student : Person {}

Now, say I get a Person:

var person = context.People.Find(<someguid>);

And, subsequently, I want to promote that Person to a Student type and save it back to the database. I have thought of a few different ideas on how this might work, but I was wondering if there is a best practice for this type of requirement.

twitchax
  • 815
  • 6
  • 14
  • possible duplicate of [Entity Framework: Inheritance, change object type](http://stackoverflow.com/questions/1239504/entity-framework-inheritance-change-object-type) – BJ Myers May 19 '15 at 01:54
  • Also possible duplicate of http://stackoverflow.com/questions/3823662/changing-inherited-types-in-entity-framework/3823925#3823925 – jjj May 19 '15 at 06:16
  • Right you are! I apparently don't know how to search. – twitchax May 19 '15 at 06:25
  • Not possible. See: http://stackoverflow.com/questions/1239504/entity-framework-inheritance-change-object-type http://stackoverflow.com/questions/3823662/changing-inherited-types-in-entity-framework/3823925#3823925 – twitchax May 19 '15 at 06:26

0 Answers0