我是asp.net核心的新手,我从udemy那里学到了一门课程。我做的每件事都像老师一样。当我尝试将测试数据添加到数据库时,我得到错误System.InvalidOperationException: 'The instance of entity type 'ProductCategorymodelBuilder.Entity<ProductCategory>().HasKey(c => new { c.CategoryId, c.ProductId });
使用EF核心控制台应用程序,我需要给管理员用户选择复选框的能力,并按下按钮,基本上运行这个伪代码状态
update EF Table set active = 'Yes' where userID =System.InvalidOperationException:“无法跟踪实体类型'Test‘的实例,因为另一个具有{'OrderId'}键值相同的实例</em