if you run into the following error using Entity Framework:
Unable to update the EntitySet because it has a DefiningQuery and no <UpdateFunction> element exists in the <ModificationFunctionMapping> element to support the current operation
It’s likely because you haven’t set a primary key in your database and/or edmx
Sometimes I feel tables (join tables) don’t need primary keys but it seems wise to just bite the bullet and add it for EF sake. Though for a join table you could simply delete/insert instead of updating it and forgo the key.
Solution is to add the primary key and then remove the table from your edmx. Then right click and” update model from database …”
Done and done!
Discussion
No comments yet.