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

c# - Update a combobox from a presenter (MVP) -

How to understand 2 main() functions after using uftrace to profile the C++ program? -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -