Entity Framework Code First and Multiple Assemblies

后端 未结 3 1604
遇见更好的自我
遇见更好的自我 2021-01-03 04:48

I have a subclass in a different assembly to its base class. The parent is a POCO class used for EF Code First.

When I try to add an instance of inherited class to t

3条回答
  •  悲&欢浪女
    2021-01-03 05:10

    I solved this by inheriting from the first assembliy's DbContext, adding a DbSet<> for the derived class, and then adding new instances of derived type to to that.

    Posted code on MSDN forum here.

提交回复
热议问题