c# - linq : update/delete junction table have two Primary Key -


    public void update (rate a)     {            = (from ee in datacontext.rates                 ee.users_id == a.users_id && ee.books_id == a.books_id                         select ee).singleordefault();          datacontext.submitchanges();     } 

error:

violation of primary key constraint 'pk_rates'. cannot insert duplicate key in object 'dbo.rates'. duplicate key value (3, 1).


Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -