ADO.NET Entity Framework: Can I have multiple entity types for the same row.

Posted by black_nm on Stack Overflow See other posts from Stack Overflow or by black_nm
Published on 2010-04-13T13:53:05Z Indexed on 2010/04/13 14:12 UTC
Read the original article Hit count: 353

Filed under:
|
|

Hi all,

I have a base class Participants inherited by Artist, Author and TextWriter. I have only one table in the data store: Participants { ID, FirstName, LastName, IsArtist, IsAuthor, IsTextWriter, } The idea is to have a class for all the roles that a participant can have.

I've managed to create the edmx file but when I try to get an Participant (as Artist) that is also an Author I receive the following error:

All objects in the EntitySet 'Participants' must have unique primary keys. However, an instance of type 'Artist' and an instance of type 'Author' both have the same primary key value, 'EntitySet=Participants;ID=1'.

Thank you

© Stack Overflow or respective owner

Related posts about ADO.NET

Related posts about entity-framework