用微软EntityFrameworkCore 修改数据时候报错,错误信息:The instance of entity type 'JdyLog' 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.
在更新方法前增加 ,即可解决问题:
ChangeTracker.Clear();