Entity framework and inheritance: NotSupportedException

前端 未结 3 1213
暖寄归人
暖寄归人 2021-02-20 16:02

I\'m getting

System.NotSupportedException: All objects in the EntitySet \'Entities.Message\' must have unique primary keys. However, an instance of

3条回答
  •  误落风尘
    2021-02-20 16:37

    I am not an EF kind of guy (busy working with NHibernate, haven't had time to get up to date with EF yet) so I may be totally wrong here, but could the problem be that the two tables (since you are using inheritance by table-per-type) have primary keys that collide?

    If you check the data in both tables, do primary key values collide?

提交回复
热议问题