.AsNoTracking() 修改实体 无法跟踪实体类型'xxx'的实例,因为已经在跟踪具有{'ID'}相同键值的另一个实例

C共享公交车 发布于 07/22 16:11
阅读 47
收藏 0

开源软件供应链点亮计划,等你来!>>>

--------------------------------------------------成功-------------------------------------------------

----------------------------------------------------失败-----------------------------------------------

谁能告诉我AsNoTracking不跟踪为什么会修改失败?

异常信息:System. InvalidOperationException:“The instance of entity type 'User' cannot be tracked because another instance with the same key value for {'ID'} is already being tracked.  When attaching existing entities, ensure that only one entity instance with a given key value is attached.  Consider using 'DbContextOptionsBuilder. EnableSensitiveDataLogging' to see the conflicting key values.”

加载中
0
Jiang-dev
Jiang-dev
该评论暂时无法显示,详情咨询 QQ 群:912889742
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部