[英]Automapper for use with Entity Framework using repository pattern?
[英]Why is there no call to repository's update method for this request (Entity Framework, automapper, repository pattern)?
SaveChangesAsync 如何调用存储库上的更新方法?
DbContext是存储库,它跟踪 oldCamp object。 当SaveChagnes () 被调用时,它将检测到任何被跟踪实体的更改并采取适当的操作(插入、更新或删除)。
在后台SaveChangesAsync()
将自动调用DetectChanges()
以在保存到底层数据库之前发现对实体实例的任何更改。 这可以通过AutoDetectChangesEnabled
禁用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.