多态代码优先模型和查询

时间:2018-11-20 17:33:36

标签: c# inheritance ef-code-first ef-core-2.1

我正在尝试构建调查系统,并希望通过代码优先的迁移在Question模型上使用继承。

public class MultipleChoiceQuestion : Question {
  public bool AllowMultipleSelection { get; set; }
  public List<MCQOption> Options { get; set; }
}

即使我添加另一个DbSet<MultipleChoiceQuestion>,它也不会出现在迁移中。我在做什么错了?

0 个答案:

没有答案