为什么没有为此请求调用存储库的更新方法(Entity Framework、自动映射器、存储库模式)?

Why is there no call to repository's update method for this request (Entity Framework, automapper, repository pattern)?

我试图理解以下屏幕截图中的代码。映射操作后,对象不会写回存储库。这个概念叫什么? SaveChangesAsync 如何调用存储库上的更新方法?

How does SaveChangesAsync make call to the update method on the repository?

DbContext 存储库,它正在跟踪 oldCamp 对象。当 SaveChagnes() is called it will detect changes 到任何跟踪的实体并采取适当的操作(插入、更新或删除)。

Under the hood SaveChangesAsync() 将自动调用 DetectChanges() 以在保存到基础数据库之前发现对实体实例的任何更改。这可以通过 AutoDetectChangesEnabled.

禁用