Entity framework and inheritance: NotSupportedException
问题 I'm getting System.NotSupportedException: All objects in the EntitySet 'Entities.Message' must have unique primary keys. However, an instance of type 'Model.Message' and an instance of type 'Model.Comment' both have the same primary key value but I have no idea what this means. Using EF4, I have a bunch of entities of type Message. Some of these messages are actually a subtype, Comment, inheritance by table-per-type. Just DB.Message.First(); will produce the exception. I have other instances