public void Update (Rate a)
    {
           a = (from ee in DataContext.Rates
                where ee.users_Id == a.users_Id && ee.books_Id == a.books_Id
                        select ee).SingleOrDefault();

        DataContext.SubmitChanges();
    }

错误:

违反PRIMARY KEY约束'PK_Rates' . 无法在对象'dbo.Rates'中插入重复键 . 重复键值为(3,1) .