How to map object of one class to another class with EF code first TPH

52 views Asked by At

Scenario

I have e.g. abstract class called Quiz and two children of this Quiz: SingleAnswerQuiz and MultipleAnswerQuiz. I map this model into Table per hierarchy with entity framework.

Problem

Is there any way to change one SingleAnswerQuiz type to MultipleAnswerQuiz? I do not want to delete single quiz and create multiple with data of deleted quiz. I want to have the same id after "mapping". Should I use Discriminator?

0

There are 0 answers