Table treated as view when no primary key is defined in the DB

Posted by

I was receiving the following error:

Unable to update the EntitySet 'Player' because it has a DefiningQuery and no element exists in the element to support the current operation.

Turns out that Entity Framework treats tables that are created without an explicit primary key, as views, and therefore does not generate an update function.   As usual, a StackOverFlow post quickly put my mind on track.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s