分类

链接

2024 年 10 月
 123456
78910111213
14151617181920
21222324252627
28293031  

近期文章

热门标签

新人福利,免费薅羊毛

The instance of entity type ‘Customer’ cannot be tracked because another instance with the same key value for {‘Id’} is already being tracked.

我的办法是,在编辑时,重新从数据库中查询一次即可。 var c = dbContext.Customers.FirstOrDefault(f => f.Id == id); //update c dbContext.SaveChanges();

.NET 暂无评论 阅读(24)