For tables with keys, everything works fine. However, for a table without any keys, every field is marked as an "entity key". Also, if I add keys to a table and then update entity framework, nothing changes. Every field is still set as an entity key in entity framework.
Asked
Active
Viewed 41 times
0
-
In Entity Framework each table needs a primary key. http://stackoverflow.com/questions/3996782/entity-framework-table-without-primary-key – The Muffin Man Sep 11 '14 at 17:16
-
Every table *should have* a proper primary key anyway .... – marc_s Sep 11 '14 at 18:10
-
Are you sure you mean table and not View? EF treats all non-nullable fields in a view as a primary key. – Erik Funkenbusch Sep 11 '14 at 18:58
-
It's definitely a table. I guess EF treats tables and views in the same way in this regard. – Jason Cheng Sep 11 '14 at 20:57