0

trying to add a table without a PK, EF throws this warning:

Error 6013: The table/view does not have a primary key defined and no valid primary key could be inferred. This table/view has been excluded. To use the entity, you will need to review your schema, add the correct keys, and uncomment it.

I cant change anything in the database, since i only have a reading user to read data from it.

Is there a way to add the table to the context, even there is no PK?

Thanks

hermgerm
  • 51
  • 7
  • 1
    You might have a look at this [answer](https://stackoverflow.com/questions/15381233/can-we-have-table-without-primary-key-in-entity-framework) – ywwy Feb 25 '19 at 07:35
  • 1
    Possible duplicate of [Can we have table without primary key in entity framework?](https://stackoverflow.com/questions/15381233/can-we-have-table-without-primary-key-in-entity-framework) – VDWWD Feb 25 '19 at 10:31

0 Answers0